diff --git a/.env.sample b/.env.sample index f37bb8833..100b7cc5d 100644 --- a/.env.sample +++ b/.env.sample @@ -11,9 +11,11 @@ APP_HOST=http://localhost:3001 EXTENSIONS_MANAGER_LOCATION=extensions/extensions-manager/dist/index.html BATCH_MANAGER_LOCATION=extensions/batch-manager/dist/index.min.html SF_DEFAULT_SERVER=http://localhost:3000 +SF_NEXT_VERSION_SERVER=http://localhost:3000 # Development options DEV_DEFAULT_SYNC_SERVER=https://sync.standardnotes.org +DEV_NEXT_VERSION_SYNC_SERVER=https://api.standardnotes.com DEV_EXTENSIONS_MANAGER_LOCATION=public/extensions/extensions-manager/dist/index.html DEV_BATCH_MANAGER_LOCATION=public/extensions/batch-manager/dist/index.min.html diff --git a/README.md b/README.md index f7a3ea668..44f760c09 100644 --- a/README.md +++ b/README.md @@ -108,10 +108,13 @@ The web app makes use of two optional native extensions, which, when running the BATCH_MANAGER_LOCATION=extensions/batch-manager/dist/index.min.html ``` -You can also set the `SF_DEFAULT_SERVER` environment variable to set the default server for login and registration. +You can also set the `SF_DEFAULT_SERVER` and `SF_NEXT_VERSION_SERVER` environment variables to set the default servers for login and registration. + +> **Note:** SF_NEXT_VERSION_SERVER can point to the same server. It is used for gradual upgrade of API versions. ``` SF_DEFAULT_SERVER=https://sync.myserver +SF_NEXT_VERSION_SERVER=https://sync.myserver ``` --- diff --git a/app/assets/javascripts/app.ts b/app/assets/javascripts/app.ts index 8adffd559..16b54ebf4 100644 --- a/app/assets/javascripts/app.ts +++ b/app/assets/javascripts/app.ts @@ -88,7 +88,8 @@ function reloadHiddenFirefoxTab(): boolean { const startApplication: StartApplication = async function startApplication( defaultSyncServerHost: string, - bridge: Bridge + bridge: Bridge, + nextVersionSyncServerHost: string, ) { if (reloadHiddenFirefoxTab()) { return; @@ -105,6 +106,7 @@ const startApplication: StartApplication = async function startApplication( .config(configRoutes) .constant('bridge', bridge) .constant('defaultSyncServerHost', defaultSyncServerHost) + .constant('nextVersionSyncServerHost', nextVersionSyncServerHost) .constant('appVersion', bridge.appVersion); // Controllers @@ -186,7 +188,8 @@ const startApplication: StartApplication = async function startApplication( if (__WEB__) { startApplication( (window as any)._default_sync_server, - new BrowserBridge(__VERSION__) + new BrowserBridge(__VERSION__), + (window as any)._next_version_sync_server ); } else { (window as any).startApplication = startApplication; diff --git a/app/assets/javascripts/components/NotesOptions.tsx b/app/assets/javascripts/components/NotesOptions.tsx index 8c80f5f54..b2a0ac3b4 100644 --- a/app/assets/javascripts/components/NotesOptions.tsx +++ b/app/assets/javascripts/components/NotesOptions.tsx @@ -72,11 +72,11 @@ export const NotesOptions = observer( const buttonRect = tagsButtonRef.current.getBoundingClientRect(); const footerHeight = 32; - if ((buttonRect.top + maxTagsMenuSize) > (clientHeight - footerHeight)) { + if (buttonRect.top + maxTagsMenuSize > clientHeight - footerHeight) { setTagsMenuMaxHeight(clientHeight - buttonRect.top - footerHeight - 2); } - if ((buttonRect.right + maxTagsMenuSize) > clientWidth) { + if (buttonRect.right + maxTagsMenuSize > clientWidth) { setTagsMenuPosition({ top: buttonRect.top, right: clientWidth - buttonRect.left, @@ -88,7 +88,6 @@ export const NotesOptions = observer( }); } - setTagsMenuOpen(!tagsMenuOpen); }; @@ -169,7 +168,7 @@ export const NotesOptions = observer( {appState.tags.tags.map((tag) => (