mirror of
https://github.com/colanode/colanode.git
synced 2026-05-18 05:05:03 +02:00
Improve server loading and syncing (#253)
This commit is contained in:
@@ -186,6 +186,10 @@ const initApp = async (): Promise<AppInitOutput> => {
|
||||
await app.metadata.delete('app', 'theme.mode');
|
||||
}
|
||||
|
||||
// add default Colanode servers
|
||||
await app.createServer(new URL('https://eu.colanode.com/config'));
|
||||
await app.createServer(new URL('https://us.colanode.com/config'));
|
||||
|
||||
return 'success';
|
||||
};
|
||||
|
||||
|
||||
@@ -9,7 +9,13 @@ import {
|
||||
import { QueryInput, QueryMap } from '@colanode/client/queries';
|
||||
import { AppMeta, AppService } from '@colanode/client/services';
|
||||
import { AppInitOutput } from '@colanode/client/types';
|
||||
import { build, extractFileSubtype, generateId, IdType } from '@colanode/core';
|
||||
import {
|
||||
build,
|
||||
extractFileSubtype,
|
||||
generateId,
|
||||
IdType,
|
||||
isColanodeDomain,
|
||||
} from '@colanode/core';
|
||||
import {
|
||||
BroadcastInitMessage,
|
||||
BroadcastMessage,
|
||||
@@ -72,6 +78,12 @@ navigator.locks.request('colanode', async () => {
|
||||
await app.metadata.set('app', 'version', build.version);
|
||||
await app.metadata.set('app', 'platform', appMeta.platform);
|
||||
|
||||
const domain = self.location.hostname;
|
||||
if (isColanodeDomain(domain)) {
|
||||
await app.createServer(new URL('https://eu.colanode.com/config'));
|
||||
await app.createServer(new URL('https://us.colanode.com/config'));
|
||||
}
|
||||
|
||||
appInitOutput = 'success';
|
||||
|
||||
broadcastMessage({
|
||||
|
||||
Reference in New Issue
Block a user