feat(BRIDGE-356): Added retry logic for unavailable preferred keychain on Linux; Feature flag support before bridge initialization; Refactored some bits of the code;
This commit is contained in:
@ -28,6 +28,7 @@ import (
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/bridge"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/constants"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/events"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/platform"
|
||||
"github.com/ProtonMail/proton-bridge/v3/pkg/restarter"
|
||||
|
||||
"github.com/abiosoft/ishell"
|
||||
@ -148,7 +149,7 @@ func New(
|
||||
fe.AddCmd(dohCmd)
|
||||
|
||||
//goland:noinspection GoBoolExpressions
|
||||
if runtime.GOOS == "darwin" {
|
||||
if runtime.GOOS == platform.MACOS {
|
||||
// Apple Mail commands.
|
||||
configureCmd := &ishell.Cmd{
|
||||
Name: "configure-apple-mail",
|
||||
@ -165,7 +166,7 @@ func New(
|
||||
}
|
||||
|
||||
//goland:noinspection GoBoolExpressions
|
||||
if runtime.GOOS == "darwin" {
|
||||
if runtime.GOOS == platform.MACOS {
|
||||
certCmd.AddCmd(&ishell.Cmd{
|
||||
Name: "status",
|
||||
Help: "Check if the TLS certificate used by Bridge is installed in the OS keychain",
|
||||
|
||||
@ -39,6 +39,7 @@ import (
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/certs"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/events"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/hv"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/platform"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/safe"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/service"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/updater"
|
||||
@ -685,5 +686,5 @@ func computeFileSocketPath() (string, error) {
|
||||
// useFileSocket return true iff file socket should be used for the gRPC service.
|
||||
func useFileSocket() bool {
|
||||
//goland:noinspection GoBoolExpressions
|
||||
return runtime.GOOS != "windows"
|
||||
return runtime.GOOS != platform.WINDOWS
|
||||
}
|
||||
|
||||
@ -32,6 +32,7 @@ import (
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/frontend/theme"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/hv"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/kb"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/platform"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/safe"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/service"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/updater"
|
||||
@ -688,7 +689,7 @@ func (s *Service) SetDiskCachePath(_ context.Context, newPath *wrapperspb.String
|
||||
path := newPath.Value
|
||||
|
||||
//goland:noinspection GoBoolExpressions
|
||||
if (runtime.GOOS == "windows") && (path[0] == '/') {
|
||||
if (runtime.GOOS == platform.WINDOWS) && (path[0] == '/') {
|
||||
path = path[1:]
|
||||
}
|
||||
|
||||
|
||||
@ -19,6 +19,8 @@ package theme
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/platform"
|
||||
)
|
||||
|
||||
type Theme string
|
||||
@ -34,7 +36,7 @@ func IsAvailable(have Theme) bool {
|
||||
|
||||
func DefaultTheme() Theme {
|
||||
switch runtime.GOOS {
|
||||
case "darwin", "windows":
|
||||
case platform.MACOS, platform.WINDOWS:
|
||||
return detectSystemTheme()
|
||||
default:
|
||||
return Light
|
||||
|
||||
Reference in New Issue
Block a user