MCPcopy Create free account
hub / github.com/NsLearning/LangHelper / invoke

Function invoke

ChatGPT/src-tauri/src/scripts/core.js:19–37  ·  view source on GitHub ↗
(cmd, args)

Source from the content-addressed store, hash-verified

17 return identifier;
18}
19async function invoke(cmd, args) {
20 return new Promise((resolve, reject) => {
21 if (!window.__TAURI_POST_MESSAGE__) reject('__TAURI_POST_MESSAGE__ does not exist!');
22 const callback = transformCallback((e) => {
23 resolve(e);
24 Reflect.deleteProperty(window, `_${error}`);
25 }, true)
26 const error = transformCallback((e) => {
27 reject(e);
28 Reflect.deleteProperty(window, `_${callback}`);
29 }, true)
30 window.__TAURI_POST_MESSAGE__({
31 cmd,
32 callback,
33 error,
34 ...args
35 });
36 });
37}
38
39async function message(message) {
40 invoke('messageDialog', {

Callers 15

ChatLayoutFunction · 0.85
checkAppUpdateFunction · 0.85
handlePreviewFunction · 0.85
handleSyncFunction · 0.85
handleSyncFunction · 0.85
handleRefreshFunction · 0.85
SettingsFunction · 0.85
onResetFunction · 0.85
onFinishFunction · 0.85
AboutFunction · 0.85
DashboardFunction · 0.85
handleLinkFunction · 0.85

Calls 1

transformCallbackFunction · 0.85

Tested by

no test coverage detected