mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-17 23:56:56 +00:00
GODT-1522: Rebuild macOS keychain notification
This commit is contained in:
@ -601,6 +601,14 @@ Window {
|
||||
root.notifyHasNoKeychain()
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
text: "Rebuild keychain"
|
||||
colorScheme: root.colorScheme
|
||||
onClicked: {
|
||||
root.notifyRebuildKeychain()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -825,6 +833,7 @@ Window {
|
||||
}
|
||||
signal changeKeychainFinished()
|
||||
signal notifyHasNoKeychain()
|
||||
signal notifyRebuildKeychain()
|
||||
|
||||
signal noActiveKeyForRecipient(string email)
|
||||
signal showMainWindow()
|
||||
|
||||
@ -115,4 +115,9 @@ Item {
|
||||
colorScheme: root.colorScheme
|
||||
notification: root.notifications.noKeychain
|
||||
}
|
||||
|
||||
NotificationDialog {
|
||||
colorScheme: root.colorScheme
|
||||
notification: root.notifications.rebuildKeychain
|
||||
}
|
||||
}
|
||||
|
||||
@ -73,7 +73,8 @@ QtObject {
|
||||
root.enableLocalCache,
|
||||
root.resetBridge,
|
||||
root.deleteAccount,
|
||||
root.noKeychain
|
||||
root.noKeychain,
|
||||
root.rebuildKeychain
|
||||
]
|
||||
|
||||
// Connection
|
||||
@ -901,4 +902,36 @@ QtObject {
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
property Notification rebuildKeychain: Notification {
|
||||
title: qsTr("Your macOS keychain might be corrupted")
|
||||
description: qsTr("Bridge is not able to access your macOS keychain. Please consult the instructions on our support page.")
|
||||
brief: title
|
||||
icon: "./icons/ic-exclamation-circle-filled.svg"
|
||||
type: Notification.NotificationType.Danger
|
||||
group: Notifications.Group.Dialogs | Notifications.Group.Configuration
|
||||
|
||||
property var supportLink: "https://protonmail.com/support/knowledge-base/macos-keychain-corrupted"
|
||||
|
||||
|
||||
Connections {
|
||||
target: root.backend
|
||||
|
||||
onNotifyRebuildKeychain: {
|
||||
console.log("notifications")
|
||||
root.rebuildKeychain.active = true
|
||||
}
|
||||
}
|
||||
|
||||
action: [
|
||||
Action {
|
||||
text: qsTr("Open the support page")
|
||||
|
||||
onTriggered: {
|
||||
Qt.openUrlExternally(root.rebuildKeychain.supportLink)
|
||||
root.backend.quit()
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,6 +26,7 @@ import (
|
||||
|
||||
"github.com/ProtonMail/proton-bridge/internal/bridge"
|
||||
"github.com/ProtonMail/proton-bridge/internal/events"
|
||||
"github.com/ProtonMail/proton-bridge/pkg/keychain"
|
||||
)
|
||||
|
||||
func (f *FrontendQt) watchEvents() {
|
||||
@ -64,7 +65,11 @@ func (f *FrontendQt) watchEvents() {
|
||||
if strings.Contains(errorDetails, "SMTP failed") {
|
||||
f.qml.PortIssueSMTP()
|
||||
}
|
||||
case <-credentialsErrorCh:
|
||||
case reason := <-credentialsErrorCh:
|
||||
if reason == keychain.ErrMacKeychainRebuild.Error() {
|
||||
f.qml.NotifyRebuildKeychain()
|
||||
continue
|
||||
}
|
||||
f.qml.NotifyHasNoKeychain()
|
||||
case email := <-noActiveKeyForRecipientCh:
|
||||
f.qml.NoActiveKeyForRecipient(email)
|
||||
|
||||
@ -142,6 +142,7 @@ type QMLBackend struct {
|
||||
_ func(keychain string) `slot:"changeKeychain"`
|
||||
_ func() `signal:"changeKeychainFinished"`
|
||||
_ func() `signal:"notifyHasNoKeychain"`
|
||||
_ func() `signal:"notifyRebuildKeychain"`
|
||||
|
||||
_ func(email string) `signal:noActiveKeyForRecipient`
|
||||
_ func() `signal:showMainWindow`
|
||||
|
||||
Reference in New Issue
Block a user