MCPcopy Index your code
hub / github.com/MALSync/MALSync / openCorrection

Method openCorrection

src/_provider/Search/vueSearchClass.ts:21–50  ·  view source on GitHub ↗
(syncMode = false)

Source from the content-addressed store, hash-verified

19 }
20
21 public openCorrection(syncMode = false): Promise<boolean> {
22 return new Promise((resolve, reject) => {
23 if (this.vueInstance) {
24 this.vueInstance.$.appContext.app.unmount();
25 if (!syncMode) {
26 resolve(false);
27 return;
28 }
29 }
30
31 const flasmessage = utils.flashm('<div class="ms-shadow"></div>', {
32 permanent: true,
33 position: 'top',
34 type: 'correction',
35 });
36
37 this.vueInstance = createApp(correctionApp, flasmessage.find('.ms-shadow').get(0)!, {
38 shadowDom: true,
39 });
40 this.vueInstance.searchClass = this;
41 this.vueInstance.syncMode = syncMode;
42 this.vueInstance.unmountFnc = () => {
43 resolve(this.changed);
44 flasmessage.remove();
45 this.vueInstance = undefined;
46 };
47
48 this.keyInterrupt();
49 });
50 }
51
52 public isCorrectionMenuOpen() {
53 return j.$('.type-correction').length > 0;

Callers 1

openCorrectionCheckMethod · 0.95

Calls 4

keyInterruptMethod · 0.95
createAppFunction · 0.90
removeMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected