Browse Source

rephrase: "Not configured yet" to "Not authorized yet"

...to guide the users to click the "Authorize" button.
tophf 4 years ago
parent
commit
bec9f65fc4

+ 3 - 3
src/_locales/en/messages.yml

@@ -653,9 +653,9 @@ msgSyncInit:
 msgSyncInitError:
   description: Message shown when sync fails in initialization.
   message: Initializing error!
-msgSyncNotConfigured:
-  description: Message shown when the selected sync provider hasn't been configured yet.
-  message: Not configured yet.
+msgSyncNoAuthYet:
+  description: Message shown when the selected sync provider hasn't been authorized yet.
+  message: Not authorized yet.
 msgSyncReady:
   description: Message shown when sync will start soon.
   message: Sync will start soon...

+ 3 - 3
src/background/sync/base.js

@@ -210,7 +210,7 @@ export const BaseService = serviceFactory({
     this.config = serviceConfig(this.name);
     this.authState = serviceState([
       'idle',
-      'not-configured',
+      'no-auth',
       'initializing',
       'authorizing', // in case some services require asynchronous requests to get access_tokens
       'authorized',
@@ -270,12 +270,12 @@ export const BaseService = serviceFactory({
   prepare() {
     this.authState.set('initializing');
     return (this.initToken() ? Promise.resolve(this.user()) : Promise.reject({
-      type: 'not-configured',
+      type: 'no-auth',
     }))
     .then(() => {
       this.authState.set('authorized');
     }, (err) => {
-      if (['not-configured', 'unauthorized'].includes(err?.type)) {
+      if (['no-auth', 'unauthorized'].includes(err?.type)) {
         this.authState.set(err.type);
       } else {
         console.error(err);

+ 3 - 3
src/options/views/tab-settings/vm-sync.vue

@@ -129,7 +129,7 @@ export default {
       const { service } = this;
       if (service) {
         const canAuthorize = ['idle', 'error'].includes(service.syncState)
-          && ['not-configured', 'unauthorized', 'error', 'authorized'].includes(service.authState);
+          && ['no-auth', 'unauthorized', 'error', 'authorized'].includes(service.authState);
         const canSync = canAuthorize && service.authState === 'authorized';
         return {
           message: this.getMessage(),
@@ -156,7 +156,7 @@ export default {
       if (['authorized'].includes(service.authState)) {
         // revoke
         sendCmd('SyncRevoke');
-      } else if (['not-configured', 'unauthorized', 'error'].includes(service.authState)) {
+      } else if (['no-auth', 'unauthorized', 'error'].includes(service.authState)) {
         // authorize
         sendCmd('SyncAuthorize');
       }
@@ -167,7 +167,7 @@ export default {
     getMessage() {
       const { service } = this;
       if (service.authState === 'initializing') return this.i18n('msgSyncInit');
-      if (service.authState === 'not-configured') return this.i18n('msgSyncNotConfigured');
+      if (service.authState === 'no-auth') return this.i18n('msgSyncNoAuthYet');
       if (service.authState === 'error') return this.i18n('msgSyncInitError');
       if (service.authState === 'unauthorized') return this.i18n('msgSyncInitError');
       if (service.syncState === 'error') return this.i18n('msgSyncError');