chore(@desktop/onboarding): splash screen used as app loading animation
Fixes #5753
This commit is contained in:
parent
db44bc25d3
commit
70a1381e86
|
@ -242,6 +242,7 @@ proc importMnemonic*(self: Controller): bool =
|
||||||
return false
|
return false
|
||||||
|
|
||||||
proc setupAccount(self: Controller, accountId: string, storeToKeychain: bool, keycardUsage: bool) =
|
proc setupAccount(self: Controller, accountId: string, storeToKeychain: bool, keycardUsage: bool) =
|
||||||
|
self.delegate.moveToLoadingAppState()
|
||||||
let error = self.accountsService.setupAccount(accountId, self.tmpPassword, self.tmpDisplayName, keycardUsage)
|
let error = self.accountsService.setupAccount(accountId, self.tmpPassword, self.tmpDisplayName, keycardUsage)
|
||||||
if error != "":
|
if error != "":
|
||||||
self.delegate.setupAccountError(error)
|
self.delegate.setupAccountError(error)
|
||||||
|
@ -276,6 +277,7 @@ proc setupKeycardAccount*(self: Controller, storeToKeychain: bool) =
|
||||||
# if `tmpSeedPhrase` is not empty means user has recovered keycard via seed phrase
|
# if `tmpSeedPhrase` is not empty means user has recovered keycard via seed phrase
|
||||||
self.storeKeycardAccountAndLogin(storeToKeychain)
|
self.storeKeycardAccountAndLogin(storeToKeychain)
|
||||||
else:
|
else:
|
||||||
|
self.delegate.moveToLoadingAppState()
|
||||||
self.accountsService.setupAccountKeycard(self.tmpKeycardEvent)
|
self.accountsService.setupAccountKeycard(self.tmpKeycardEvent)
|
||||||
if storeToKeychain:
|
if storeToKeychain:
|
||||||
singletonInstance.localAccountSettings.setStoreToKeychainValue(LS_VALUE_STORE)
|
singletonInstance.localAccountSettings.setStoreToKeychainValue(LS_VALUE_STORE)
|
||||||
|
@ -316,12 +318,14 @@ proc tryToObtainDataFromKeychain*(self: Controller) =
|
||||||
self.keychainService.tryToObtainData(selectedAccount.name)
|
self.keychainService.tryToObtainData(selectedAccount.name)
|
||||||
|
|
||||||
proc login*(self: Controller) =
|
proc login*(self: Controller) =
|
||||||
|
self.delegate.moveToLoadingAppState()
|
||||||
let selectedAccount = self.getSelectedLoginAccount()
|
let selectedAccount = self.getSelectedLoginAccount()
|
||||||
let error = self.accountsService.login(selectedAccount, self.tmpPassword)
|
let error = self.accountsService.login(selectedAccount, self.tmpPassword)
|
||||||
if(error.len > 0):
|
if(error.len > 0):
|
||||||
self.delegate.emitAccountLoginError(error)
|
self.delegate.emitAccountLoginError(error)
|
||||||
|
|
||||||
proc loginAccountKeycard*(self: Controller) =
|
proc loginAccountKeycard*(self: Controller) =
|
||||||
|
self.delegate.moveToLoadingAppState()
|
||||||
let error = self.accountsService.loginAccountKeycard(self.tmpKeycardEvent)
|
let error = self.accountsService.loginAccountKeycard(self.tmpKeycardEvent)
|
||||||
if(error.len > 0):
|
if(error.len > 0):
|
||||||
self.delegate.emitAccountLoginError(error)
|
self.delegate.emitAccountLoginError(error)
|
||||||
|
|
|
@ -26,7 +26,7 @@ method resolveKeycardNextState*(self: LoginKeycardEnterPinState, keycardFlowType
|
||||||
keycardEvent.error.len == 0:
|
keycardEvent.error.len == 0:
|
||||||
controller.setKeycardEvent(keycardEvent)
|
controller.setKeycardEvent(keycardEvent)
|
||||||
controller.loginAccountKeycard()
|
controller.loginAccountKeycard()
|
||||||
return
|
return nil
|
||||||
if keycardFlowType == ResponseTypeValueEnterPIN and
|
if keycardFlowType == ResponseTypeValueEnterPIN and
|
||||||
keycardEvent.error.len > 0 and
|
keycardEvent.error.len > 0 and
|
||||||
keycardEvent.error == RequestParamPIN:
|
keycardEvent.error == RequestParamPIN:
|
||||||
|
|
|
@ -12,6 +12,9 @@ method delete*(self: AccessInterface) {.base.} =
|
||||||
method load*(self: AccessInterface) {.base.} =
|
method load*(self: AccessInterface) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
method moveToLoadingAppState*(self: AccessInterface) {.base.} =
|
||||||
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method moveToAppState*(self: AccessInterface) {.base.} =
|
method moveToAppState*(self: AccessInterface) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,9 @@ method load*[T](self: Module[T]) =
|
||||||
self.view.setCurrentStartupState(newLoginState(FlowType.AppLogin, nil))
|
self.view.setCurrentStartupState(newLoginState(FlowType.AppLogin, nil))
|
||||||
self.delegate.startupDidLoad()
|
self.delegate.startupDidLoad()
|
||||||
|
|
||||||
|
method moveToLoadingAppState*[T](self: Module[T]) =
|
||||||
|
self.view.setAppState(AppState.AppLoadingState)
|
||||||
|
|
||||||
method moveToAppState*[T](self: Module[T]) =
|
method moveToAppState*[T](self: Module[T]) =
|
||||||
self.view.setAppState(AppState.MainAppState)
|
self.view.setAppState(AppState.MainAppState)
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ import models/login_account_item as login_acc_item
|
||||||
type
|
type
|
||||||
AppState* {.pure.} = enum
|
AppState* {.pure.} = enum
|
||||||
StartupState = 0
|
StartupState = 0
|
||||||
|
AppLoadingState
|
||||||
MainAppState
|
MainAppState
|
||||||
|
|
||||||
QtObject:
|
QtObject:
|
||||||
|
|
|
@ -5,25 +5,12 @@ import utils 1.0
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
anchors.fill: parent
|
|
||||||
visible: (opacity > 0.0001)
|
|
||||||
Behavior on opacity { NumberAnimation { duration: 250 }}
|
|
||||||
|
|
||||||
Timer {
|
|
||||||
running: true
|
|
||||||
interval: 2000
|
|
||||||
onTriggered: {
|
|
||||||
root.opacity = 0.0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AnimatedImage {
|
AnimatedImage {
|
||||||
id: splashLogo
|
width: 128
|
||||||
width: 127.88
|
height: 128
|
||||||
height: 127.88
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
source: Style.gif("status_splash_" + (Style.current.name))
|
source: Style.gif("status_splash_128_" + (Style.current.name))
|
||||||
playing: visible
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: keep it if we will decide to switch on lottie
|
// NOTE: keep it if we will decide to switch on lottie
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 121 KiB |
Binary file not shown.
After Width: | Height: | Size: 118 KiB |
|
@ -8,7 +8,8 @@ QtObject {
|
||||||
|
|
||||||
readonly property QtObject appState: QtObject {
|
readonly property QtObject appState: QtObject {
|
||||||
readonly property int startup: 0
|
readonly property int startup: 0
|
||||||
readonly property int main: 1
|
readonly property int appLoading: 1
|
||||||
|
readonly property int main: 2
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly property QtObject startupFlow: QtObject {
|
readonly property QtObject startupFlow: QtObject {
|
||||||
|
|
22
ui/main.qml
22
ui/main.qml
|
@ -130,12 +130,13 @@ StatusWindow {
|
||||||
}
|
}
|
||||||
|
|
||||||
function onAppStateChanged(state) {
|
function onAppStateChanged(state) {
|
||||||
if(state === Constants.appState.main) {
|
if(state === Constants.appState.appLoading) {
|
||||||
|
loader.sourceComponent = appLoadingAnimation
|
||||||
|
}
|
||||||
|
else if(state === Constants.appState.main) {
|
||||||
// We set main module to the Global singleton once user is logged in and we move to the main app.
|
// We set main module to the Global singleton once user is logged in and we move to the main app.
|
||||||
Global.mainModuleInst = mainModule
|
Global.mainModuleInst = mainModule
|
||||||
loader.sourceComponent = app
|
loader.sourceComponent = app
|
||||||
startupOnboarding.unload()
|
|
||||||
startupOnboarding.visible = false
|
|
||||||
|
|
||||||
if(localAccountSensitiveSettings.recentEmojis === "") {
|
if(localAccountSensitiveSettings.recentEmojis === "") {
|
||||||
localAccountSensitiveSettings.recentEmojis = [];
|
localAccountSensitiveSettings.recentEmojis = [];
|
||||||
|
@ -150,6 +151,9 @@ StatusWindow {
|
||||||
localAccountSensitiveSettings.hiddenCommunityBackUpBanners = [];
|
localAccountSensitiveSettings.hiddenCommunityBackUpBanners = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
startupOnboarding.unload()
|
||||||
|
startupOnboarding.visible = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -263,7 +267,6 @@ StatusWindow {
|
||||||
opacity: active ? 1.0 : 0.0
|
opacity: active ? 1.0 : 0.0
|
||||||
visible: (opacity > 0.0001)
|
visible: (opacity > 0.0001)
|
||||||
Behavior on opacity { NumberAnimation { duration: 120 }}
|
Behavior on opacity { NumberAnimation { duration: 120 }}
|
||||||
active: !splashScreen.visible
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
|
@ -273,10 +276,15 @@ StatusWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: appLoadingAnimation
|
||||||
|
SplashScreen {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
OnboardingLayout {
|
OnboardingLayout {
|
||||||
id: startupOnboarding
|
id: startupOnboarding
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
visible: !splashScreen.visible
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NotificationWindow {
|
NotificationWindow {
|
||||||
|
@ -312,10 +320,6 @@ StatusWindow {
|
||||||
applicationWindow.toggleFullScreen()
|
applicationWindow.toggleFullScreen()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SplashScreen {
|
|
||||||
id: splashScreen
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*##^##
|
/*##^##
|
||||||
|
|
Loading…
Reference in New Issue