Skip to content

Commit

Permalink
Fixed loading of external plugins in standalone mode
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishamm committed Sep 24, 2024
1 parent 4ea7850 commit 1bae13b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 26 deletions.
10 changes: 0 additions & 10 deletions src/plugins/imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@ import { initCollection } from "@duet3d/objectmodel";
import DwcPlugin from "./DwcPlugin";

export default initCollection(DwcPlugin, [
{
id: "ClosedLoopTuning",
name: "Closed Loop Tuning",
author: "Louis Irwin, Juan Rosario",
version: "3.6.0-beta.1",
loadDwcResources: () => import(
/* webpackChunkName: "ClosedLoopTuning" */
"./ClosedLoopTuning/index"
)
},
{
id: "GCodeViewer",
name: "G-Code Viewer",
Expand Down
31 changes: 15 additions & 16 deletions src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { closeNotifications, makeNotification } from "@/utils/notifications";
import Path from "@/utils/path";

import machine, { defaultMachine, MachineModule, MachineModuleState, MachineState } from "./machine";
import MachineCallbacks from "./machine/callbacks";
import observer from "./observer";
import settings, { SettingsState } from "./settings";
import uiInjection, { UiInjectionState } from "./uiInjection";
Expand Down Expand Up @@ -166,21 +165,7 @@ const store = new Vuex.Store<InternalRootState>({
commit("addMachine", { hostname, module });
commit("setSelectedMachine", hostname);

// Load machine settings
try {
await dispatch("machine/settings/load");
} catch (e) {
console.warn("Failed to load settings: " + getErrorMessage(e));
}

// Load cache
try {
await dispatch("machine/cache/load");
} catch (e) {
console.warn("Failed to load cache: " + getErrorMessage(e));
}

// Set up event callbacks
// Set up event callbacks before loading the settings
connectorInstance.setCallbacks({
onConnectProgress(connector: BaseConnector, progress: number) {
commit("setConnectingProgress", progress);
Expand All @@ -202,6 +187,20 @@ const store = new Vuex.Store<InternalRootState>({
}
});

// Load machine settings
try {
await dispatch("machine/settings/load");
} catch (e) {
console.warn("Failed to load settings: " + getErrorMessage(e));
}

// Load cache
try {
await dispatch("machine/cache/load");
} catch (e) {
console.warn("Failed to load cache: " + getErrorMessage(e));
}

// Perform post-connect tasks
logGlobal(LogType.success, i18n.t("events.connected", [hostname]));

Expand Down

0 comments on commit 1bae13b

Please sign in to comment.