Skip to content

Commit

Permalink
add: warning when workspace is not open
Browse files Browse the repository at this point in the history
  • Loading branch information
carsakiller committed Apr 6, 2023
1 parent 0d76557 commit 65e5f90
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/commands/appStore.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useAppStore } from "@/stores/app";
import { NotificationLevels } from "@/types/app";

type Message = {
data: {
Expand All @@ -15,6 +16,13 @@ export default (message: Message) => {
switch (property) {
case "workspaceState":
appStore.workspaceOpen = value as boolean;
if (!value) {
appStore.notifications.push({
level: NotificationLevels.warn,
message:
"A workspace is not currently open. Addons cannot be enabled/disabled when a workspace is not open!",
});
}
break;
case "clientVersion":
appStore.clientVersion = value as string;
Expand Down

0 comments on commit 65e5f90

Please sign in to comment.