Kaynağa Gözat

fix(auto-update-checker): skip update check for pinned versions (#232)

Hakim Zulkufli 4 ay önce
ebeveyn
işleme
5ac9abe5c8
1 değiştirilmiş dosya ile 5 ekleme ve 22 silme
  1. 5 22
      src/hooks/auto-update-checker/index.ts

+ 5 - 22
src/hooks/auto-update-checker/index.ts

@@ -95,6 +95,11 @@ async function runBackgroundUpdateCheck(
     return;
     return;
   }
   }
 
 
+  if (pluginInfo.isPinned) {
+    log(`[auto-update-checker] Version is pinned; skipping update check.`);
+    return;
+  }
+
   const channel = extractChannel(pluginInfo.pinnedVersion ?? currentVersion);
   const channel = extractChannel(pluginInfo.pinnedVersion ?? currentVersion);
   const latestVersion = await getLatestVersion(channel);
   const latestVersion = await getLatestVersion(channel);
   if (!latestVersion) {
   if (!latestVersion) {
@@ -129,28 +134,6 @@ async function runBackgroundUpdateCheck(
     return;
     return;
   }
   }
 
 
-  if (pluginInfo.isPinned) {
-    const updated = updatePinnedVersion(
-      pluginInfo.configPath,
-      pluginInfo.entry,
-      latestVersion,
-    );
-    if (!updated) {
-      showToast(
-        ctx,
-        `OMO-Slim ${latestVersion}`,
-        `v${latestVersion} available. Restart to apply.`,
-        'info',
-        8000,
-      );
-      log('[auto-update-checker] Failed to update pinned version in config');
-      return;
-    }
-    log(
-      `[auto-update-checker] Config updated: ${pluginInfo.entry} → ${PACKAGE_NAME}@${latestVersion}`,
-    );
-  }
-
   invalidatePackage(PACKAGE_NAME);
   invalidatePackage(PACKAGE_NAME);
 
 
   const installSuccess = await runBunInstallSafe(ctx);
   const installSuccess = await runBunInstallSafe(ctx);