mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-17 23:56:56 +00:00
GODT-1210: "free user" banner
This commit is contained in:
@ -40,6 +40,8 @@ Popup {
|
||||
|
||||
shouldShow: notification ? (notification.active && !notification.dismissed) : false
|
||||
|
||||
modal: false
|
||||
|
||||
Action {
|
||||
id: defaultDismissAction
|
||||
|
||||
|
||||
@ -129,7 +129,7 @@ ColumnLayout {
|
||||
text: "free user error"
|
||||
enabled: user !== undefined //&& user.isLoginRequested
|
||||
onClicked: {
|
||||
root.backend.loginFreeUserError("")
|
||||
root.backend.loginFreeUserError()
|
||||
user.resetLoginRequests()
|
||||
}
|
||||
}
|
||||
|
||||
@ -634,7 +634,7 @@ Window {
|
||||
|
||||
// this signals are used only when trying to login with new user (i.e. not in users model)
|
||||
signal loginUsernamePasswordError(string errorMsg)
|
||||
signal loginFreeUserError(string errorMsg)
|
||||
signal loginFreeUserError()
|
||||
signal loginConnectionError(string errorMsg)
|
||||
signal login2FARequested()
|
||||
signal login2FAError(string errorMsg)
|
||||
|
||||
@ -22,6 +22,7 @@ package qt
|
||||
import (
|
||||
"context"
|
||||
"encoding/base64"
|
||||
|
||||
"github.com/ProtonMail/proton-bridge/internal/users"
|
||||
"github.com/ProtonMail/proton-bridge/pkg/pmapi"
|
||||
)
|
||||
@ -38,7 +39,11 @@ func (f *FrontendQt) login(username, password string) {
|
||||
|
||||
f.authClient, f.auth, err = f.bridge.Login(username, f.password)
|
||||
if err != nil {
|
||||
// TODO login free user error
|
||||
if err == pmapi.ErrPaidPlanRequired {
|
||||
f.qml.LoginFreeUserError()
|
||||
f.loginClean()
|
||||
return
|
||||
}
|
||||
f.qml.LoginUsernamePasswordError(err.Error())
|
||||
f.loginClean()
|
||||
return
|
||||
|
||||
@ -55,7 +55,7 @@ type QMLBackend struct {
|
||||
_ func(username, password string) `slot:"login2Password"`
|
||||
_ func(username string) `slot:"loginAbort"`
|
||||
_ func(errorMsg string) `signal:"loginUsernamePasswordError"`
|
||||
_ func(errorMsg string) `signal:"loginFreeUserError"`
|
||||
_ func() `signal:"loginFreeUserError"`
|
||||
_ func(errorMsg string) `signal:"loginConnectionError"`
|
||||
_ func() `signal:"login2FARequested"`
|
||||
_ func(errorMsg string) `signal:"login2FAError"`
|
||||
|
||||
Reference in New Issue
Block a user