File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,14 @@ const automaticallyUpdateEndpoint = async () => {
26
26
27
27
const currentHost = window . location . host ;
28
28
if ( currentHost !== new URL ( DEFAULT_GITPOD_ENDPOINT ) . host ) {
29
- console . log ( `Gitpod extension: switching default endpoint to ${ currentHost } .` ) ;
30
- await storage . set ( STORAGE_KEY_ADDRESS , parseEndpoint ( currentHost ) ) ;
29
+ const currentlyStoredEndpoint = await storage . get < string > ( STORAGE_KEY_ADDRESS ) ;
30
+ if (
31
+ ( currentlyStoredEndpoint && new URL ( currentlyStoredEndpoint ) . host !== currentHost ) ||
32
+ ! currentlyStoredEndpoint
33
+ ) {
34
+ console . log ( `Gitpod extension: switching default endpoint to ${ currentHost } .` ) ;
35
+ await storage . set ( STORAGE_KEY_ADDRESS , parseEndpoint ( currentHost ) ) ;
36
+ }
31
37
}
32
38
} ;
33
39
You can’t perform that action at this time.
0 commit comments