diff --git a/app/src/actions/ConnectionManager.ts b/app/src/actions/ConnectionManager.ts index c20a243..7ba2204 100644 --- a/app/src/actions/ConnectionManager.ts +++ b/app/src/actions/ConnectionManager.ts @@ -13,6 +13,12 @@ const storedConnectionsIdentifier: StorageIdentifier<{[s: string]: ConnectionOpt } export const loadConnectionSettings = () => (dispatch: Dispatch, getState: () => AppState) => { + const requiresMigration = true + if (requiresMigration) { + const connections = defaultConnections() + persistantStorage.store(storedConnectionsIdentifier, connections) + } + const connections = persistantStorage.load(storedConnectionsIdentifier) if (!connections) { return diff --git a/app/src/model/ConnectionOptions.ts b/app/src/model/ConnectionOptions.ts index 7928dee..6d3abe7 100644 --- a/app/src/model/ConnectionOptions.ts +++ b/app/src/model/ConnectionOptions.ts @@ -55,28 +55,28 @@ export function createEmptyConnection(): ConnectionOptions { } export function defaultConnections() { - return [ - { + return { + 'iot.eclipse.org': { ...createEmptyConnection(), id: 'iot.eclipse.org', name: 'iot.eclipse.org', host: 'iot.eclipse.org', }, - { + 'test.mosquitto.org': { ...createEmptyConnection(), id: 'test.mosquitto.org', name: 'test.mosquitto.org', host: 'test.mosquitto.org', }, - { + 'broker.hivemq.com:8000': { ...createEmptyConnection(), - id: 'wss://broker.hivemq.com:8000/mqtt', + id: 'broker.hivemq.com:8000', name: 'broker.hivemq.com', host: 'broker.hivemq.com', - basePath: 'mqtt', + basePath: 'ws', encryption: true, protocol: 'ws', port: 8000, }, - ] + } }