Skip to content

Commit

Permalink
feat: Add all endpoints in config as printer instances (#1006)
Browse files Browse the repository at this point in the history
Import all endpoints inside config.json for multiple printer when the local storage is empty

Signed-off-by: arifhn <arif.hn@gmail.com>
  • Loading branch information
arifhn authored Jan 29, 2023
1 parent 30df5ec commit 03185c5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ export const appInit = async (apiConfig?: ApiConfig, hostConfig?: HostConfig): P
hostConfig = await getHostConfig()
}

if (!(Globals.LOCAL_INSTANCES_STORAGE_KEY in localStorage)) {
for (const endpoint of hostConfig.endpoints) {
apiConfig = Vue.$filters.getApiUrls(endpoint)
await store.dispatch('config/initLocal', { apiConfig })
}
}

// Load the API Config
if (!apiConfig) {
apiConfig = await getApiConfig(hostConfig)
Expand Down

0 comments on commit 03185c5

Please sign in to comment.