Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Don't crash during activation if toast would be triggered #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,6 @@ const sanitizeUserConfig = () => {
// Only accepts values from workspace or folder level configs
const fwVal = fwInspect.workspaceValue || fwInspect.workspaceFolderValue || fwInspect.defaultValue;

if (fwInspect.globalValue) {
showToast(
`Warning: You have enabled the bitburner file watcher in your global (user) settings, the extension will default to workspace or folder settings instead.`,
`error`,
);
}

// Checks if initializing or user config changed for fileWatcher.enabled
if (!sanitizedUserConfig || !userConfig.get(`authToken`) || sanitizedUserConfig.fwEnabled !== fwVal) {
fwEnabled = fwVal;
Expand All @@ -334,6 +327,13 @@ const sanitizeUserConfig = () => {
.replace(/^bearer/i, ``)
.trim(),
};

if (fwInspect.globalValue) {
showToast(
`Warning: You have enabled the bitburner file watcher in your global (user) settings, the extension will default to workspace or folder settings instead.`,
`error`,
);
}
};

// TODO: refine 'showToast' internal API
Expand Down