2
0
Эх сурвалжийг харах

Remove retraction.js directive

JC Brand 1 жил өмнө
parent
commit
746b2cddd7

+ 0 - 28
src/shared/directives/retraction.js

@@ -1,28 +0,0 @@
-import { __ } from 'i18n';
-import { directive } from "lit/directive";
-import { html } from "lit";
-
-
-const i18n_retract_message = __('Retract this message');
-const tplRetract = (o) => html`
-    <button class="chat-msg__action chat-msg__action-retract" title="${i18n_retract_message}" @click=${o.onMessageRetractButtonClicked}>
-        <converse-icon
-            class="fas fa-trash-alt"
-            color="var(--text-color-lighten-15-percent)"
-            size="1em"
-        ></converse-icon>
-    </button>
-`;
-
-
-export const renderRetractionLink = directive((o) => async (part) => {
-    const may_be_moderated = o.model.get('type') === 'groupchat' && await o.model.mayBeModerated();
-    const retractable = !o.is_retracted && (o.model.mayBeRetracted() || may_be_moderated);
-
-    if (retractable) {
-        part.setValue(tplRetract(o));
-    } else {
-        part.setValue('');
-    }
-    part.commit();
-});