@lvce-editor/extension-management-worker 4.38.0 → 4.38.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3066,6 +3066,9 @@ const serializeError = error => {
|
|
|
3066
3066
|
name: 'Error'
|
|
3067
3067
|
};
|
|
3068
3068
|
};
|
|
3069
|
+
const isViewActionsDomCommandNotFoundError = error => {
|
|
3070
|
+
return error instanceof Error && error.name === 'CommandNotFoundError' && error.message.includes('ExtensionApi.getViewActionsDom');
|
|
3071
|
+
};
|
|
3069
3072
|
const hasView = (extension, viewId) => {
|
|
3070
3073
|
return Array.isArray(extension.views) && extension.views.some(view => view.id === viewId);
|
|
3071
3074
|
};
|
|
@@ -3155,7 +3158,14 @@ const getViewActionsDom = async (viewId, uid, assetDir, platform) => {
|
|
|
3155
3158
|
if (!instance || instance.status === 'error') {
|
|
3156
3159
|
return undefined;
|
|
3157
3160
|
}
|
|
3158
|
-
|
|
3161
|
+
try {
|
|
3162
|
+
return await instance.rpc.invoke('ExtensionApi.getViewActionsDom', uid);
|
|
3163
|
+
} catch (error) {
|
|
3164
|
+
if (isViewActionsDomCommandNotFoundError(error)) {
|
|
3165
|
+
return undefined;
|
|
3166
|
+
}
|
|
3167
|
+
throw error;
|
|
3168
|
+
}
|
|
3159
3169
|
};
|
|
3160
3170
|
const requestViewRerender = async uid => {
|
|
3161
3171
|
await invoke$2('Viewlet.executeViewletCommand', uid, 'rerender');
|