Merge branch 'develop' into custom-challenges

This commit is contained in:
Mo Bitar
2020-09-23 15:54:54 -05:00
7 changed files with 39 additions and 13 deletions

View File

@@ -48,6 +48,6 @@ group :development, :test do
end end
gem "dogstatsd-ruby", "~> 4.8" gem "dogstatsd-ruby", "~> 4.8"
gem "ddtrace", "~> 0.38.0" gem "ddtrace", "~> 0.40"
gem "lograge", "~> 0.11.2" gem "lograge", "~> 0.11.2"

View File

@@ -67,7 +67,7 @@ GEM
concurrent-ruby (1.1.5) concurrent-ruby (1.1.5)
connection_pool (2.2.2) connection_pool (2.2.2)
crass (1.0.6) crass (1.0.6)
ddtrace (0.38.0) ddtrace (0.40.0)
msgpack msgpack
dogstatsd-ruby (4.8.1) dogstatsd-ruby (4.8.1)
dotenv (2.7.5) dotenv (2.7.5)
@@ -212,7 +212,7 @@ DEPENDENCIES
capistrano-rails capistrano-rails
capistrano-rvm capistrano-rvm
capistrano-sidekiq capistrano-sidekiq
ddtrace (~> 0.38.0) ddtrace (~> 0.40)
dogstatsd-ruby (~> 4.8) dogstatsd-ruby (~> 4.8)
dotenv-rails dotenv-rails
haml haml

View File

@@ -64,3 +64,11 @@ export const STRING_CONFIRM_APP_QUIT_DURING_PASSCODE_CHANGE =
export const STRING_CONFIRM_APP_QUIT_DURING_PASSCODE_REMOVAL = export const STRING_CONFIRM_APP_QUIT_DURING_PASSCODE_REMOVAL =
"A passcode removal is in progress. You may lose data if you quit the app. " + "A passcode removal is in progress. You may lose data if you quit the app. " +
"Are you sure you want to quit?" "Are you sure you want to quit?"
export const STRING_UPGRADE_ACCOUNT_CONFIRM_TITLE = 'Encryption upgrade available';
export const STRING_UPGRADE_ACCOUNT_CONFIRM_TEXT =
'Encryption version 004 is available for your account and local data storage. ' +
'This version strengthens the encryption algorithms for your account and ' +
'disk use. To learn more about this upgrade, visit our ' +
'<a href="https://standardnotes.org/help/security" target="_blank">Security Upgrade page.</a>';
export const STRING_UPGRADE_ACCOUNT_CONFIRM_BUTTON = 'Upgrade';

View File

@@ -19,9 +19,13 @@ import { AppStateEvent, EventSource } from '@/ui_models/app_state';
import { import {
STRING_GENERIC_SYNC_ERROR, STRING_GENERIC_SYNC_ERROR,
STRING_NEW_UPDATE_READY, STRING_NEW_UPDATE_READY,
STRING_CONFIRM_APP_QUIT_DURING_UPGRADE STRING_CONFIRM_APP_QUIT_DURING_UPGRADE,
STRING_UPGRADE_ACCOUNT_CONFIRM_TEXT,
STRING_UPGRADE_ACCOUNT_CONFIRM_TITLE,
STRING_UPGRADE_ACCOUNT_CONFIRM_BUTTON,
} from '@/strings'; } from '@/strings';
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl'; import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
import { confirmDialog } from '@/services/alertService';
/** /**
* Disable before production release. * Disable before production release.
@@ -337,9 +341,15 @@ class FooterViewCtrl extends PureViewCtrl<{}, {
} }
async openSecurityUpdate() { async openSecurityUpdate() {
preventRefreshing(STRING_CONFIRM_APP_QUIT_DURING_UPGRADE, async () => { if (await confirmDialog({
await this.application.performProtocolUpgrade(); title: STRING_UPGRADE_ACCOUNT_CONFIRM_TITLE,
}); text: STRING_UPGRADE_ACCOUNT_CONFIRM_TEXT,
confirmButtonText: STRING_UPGRADE_ACCOUNT_CONFIRM_BUTTON,
})) {
preventRefreshing(STRING_CONFIRM_APP_QUIT_DURING_UPGRADE, async () => {
await this.application.performProtocolUpgrade();
});
}
} }
findErrors() { findErrors() {

View File

@@ -95,8 +95,11 @@
label="'Date'" label="'Date'"
) )
p.empty-notes-list.faded( p.empty-notes-list.faded(
ng-if="self.state.localDataLoaded && !self.state.renderedNotes.length" ng-if="self.state.completedFullSync && !self.state.renderedNotes.length"
) No notes. ) No notes.
p.empty-notes-list.faded(
ng-if="!self.state.completedFullSync && !self.state.renderedNotes.length"
) Loading notes…
.scrollable(ng-if="self.state.renderedNotes.length") .scrollable(ng-if="self.state.renderedNotes.length")
#notes-scrollable.infinite-scroll( #notes-scrollable.infinite-scroll(
can-load='true', can-load='true',

View File

@@ -34,7 +34,7 @@ type NotesState = {
hideDate?: boolean hideDate?: boolean
noteFilter: { text: string } noteFilter: { text: string }
mutable: { showMenu: boolean } mutable: { showMenu: boolean }
localDataLoaded: boolean completedFullSync: boolean
[WebPrefKey.TagsPanelWidth]?: number [WebPrefKey.TagsPanelWidth]?: number
[WebPrefKey.NotesPanelWidth]?: number [WebPrefKey.NotesPanelWidth]?: number
[WebPrefKey.EditorWidth]?: number [WebPrefKey.EditorWidth]?: number
@@ -127,7 +127,7 @@ class NotesViewCtrl extends PureViewCtrl<{}, NotesState> {
mutable: { showMenu: false }, mutable: { showMenu: false },
noteFilter: { text: '' }, noteFilter: { text: '' },
panelTitle: '', panelTitle: '',
localDataLoaded: false, completedFullSync: false,
}; };
} }
@@ -167,6 +167,9 @@ class NotesViewCtrl extends PureViewCtrl<{}, NotesState> {
case ApplicationEvent.SignedIn: case ApplicationEvent.SignedIn:
this.appState.closeAllEditors(); this.appState.closeAllEditors();
this.selectFirstNote(); this.selectFirstNote();
this.setState({
completedFullSync: false,
});
break; break;
case ApplicationEvent.CompletedFullSync: case ApplicationEvent.CompletedFullSync:
this.getMostValidNotes().then((notes) => { this.getMostValidNotes().then((notes) => {
@@ -174,10 +177,8 @@ class NotesViewCtrl extends PureViewCtrl<{}, NotesState> {
this.createPlaceholderNote(); this.createPlaceholderNote();
} }
}); });
break;
case ApplicationEvent.LocalDataLoaded:
this.setState({ this.setState({
localDataLoaded: true, completedFullSync: true,
}); });
break; break;
} }

View File

@@ -70,3 +70,7 @@
button.sk-button { button.sk-button {
border: none; border: none;
} }
a {
color: var(--sn-stylekit-info-color);
}