feat(plugins): install marketplace packages via dbx deep link

This commit is contained in:
t8y2 committed 2026-09-15 17:55:04 +08:00
1 parent 0437f952e0
commit 94bcbc1631
18 files changed
+223 -1

No files matched your search

@@ -25,6 +25,7 @@ import { useI18n } from "vue-i18n";
const props = defineProps<{
focusTarget?: PluginCenterFocus | null;
installUrlRequest?: { id: number; url: string } | null;
}>();
const emit = defineEmits<{
@@ -534,6 +535,21 @@ watch(
},
{ deep: true },
);
let lastHandledInstallRequestId = 0;
watch(
() => props.installUrlRequest,
async (request) => {
// immediate so a deep link that just opened the Plugin Center is consumed on
// mount; the id guard keeps already-handled requests from replaying.
if (!request || request.id <= lastHandledInstallRequestId) return;
lastHandledInstallRequestId = request.id;
installUrl.value = request.url;
if (window.confirm(t("pluginPlatform.deepLinkInstallConfirm", { url: request.url }))) {
await installPluginFromUrl();
}
},
{ immediate: true },
);
watch(allowUnsigned, (value) => {
try {
localStorage.setItem(PLUGIN_ALLOW_UNSIGNED_STORAGE_KEY, value ? "1" : "0");