mirror of
https://github.com/bitwarden/browser
synced 2025-12-29 14:43:31 +00:00
address review comments
This commit is contained in:
@@ -22,7 +22,6 @@ struct CheckBrowserInstalledResponse {
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[serde(rename_all = "camelCase", tag = "type")]
|
||||
enum CommandResult<T> {
|
||||
// rename = "camelCase" was a review suggestion with breaking changes
|
||||
Success { value: T },
|
||||
Error { error: String },
|
||||
}
|
||||
@@ -180,9 +179,7 @@ async fn is_browser_installed(browser_name: &str) -> Result<bool> {
|
||||
.map(|(_, id)| *id);
|
||||
|
||||
let Some(bundle_id) = bundle_id else {
|
||||
return Ok(true); // ok_or(true) was a review suggestion with breaking changes
|
||||
// Avoid ok_or(true): serializes Result as {"Ok": "..."} instead of string
|
||||
// value
|
||||
return Ok(true);
|
||||
};
|
||||
|
||||
let input = CommandInput {
|
||||
|
||||
@@ -12,11 +12,7 @@ export class ChromiumImporterService {
|
||||
|
||||
// Used on Mac OS App Store builds to request permissions to browser entries outside the sandbox
|
||||
ipcMain.handle("chromium_importer.requestBrowserAccess", async (event, browser: string) => {
|
||||
if (chromium_importer.requestBrowserAccess) {
|
||||
return await chromium_importer.requestBrowserAccess(browser, isMacAppStore());
|
||||
}
|
||||
// requestBrowserAccess not found, returning with no-op
|
||||
return;
|
||||
return await chromium_importer.requestBrowserAccess(browser, isMacAppStore());
|
||||
});
|
||||
|
||||
ipcMain.handle("chromium_importer.getAvailableProfiles", async (event, browser: string) => {
|
||||
|
||||
@@ -1,21 +1,13 @@
|
||||
<bit-dialog #dialog dialogSize="large" background="alt">
|
||||
<bit-dialog #dialog [loading]="loading" dialogSize="large" background="alt">
|
||||
<span bitDialogTitle>{{ "import" | i18n }}</span>
|
||||
<ng-container bitDialogContent>
|
||||
<div class="tw-relative">
|
||||
<tools-import
|
||||
(formLoading)="this.loading = $event"
|
||||
(formDisabled)="this.disabled = $event"
|
||||
(onSuccessfulImport)="this.onSuccessfulImport($event)"
|
||||
[onImportFromBrowser]="this.onImportFromBrowser"
|
||||
[onLoadProfilesFromBrowser]="this.onLoadProfilesFromBrowser"
|
||||
[class.tw-invisible]="loading"
|
||||
></tools-import>
|
||||
@if (loading) {
|
||||
<div class="tw-absolute tw-inset-0 tw-flex tw-items-center tw-justify-center">
|
||||
<bit-spinner></bit-spinner>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<tools-import
|
||||
(formLoading)="this.loading = $event"
|
||||
(formDisabled)="this.disabled = $event"
|
||||
(onSuccessfulImport)="this.onSuccessfulImport($event)"
|
||||
[onImportFromBrowser]="this.onImportFromBrowser"
|
||||
[onLoadProfilesFromBrowser]="this.onLoadProfilesFromBrowser"
|
||||
></tools-import>
|
||||
</ng-container>
|
||||
<ng-container bitDialogFooter>
|
||||
<button
|
||||
|
||||
@@ -3,13 +3,7 @@ import { Component } from "@angular/core";
|
||||
|
||||
import { JslibModule } from "@bitwarden/angular/jslib.module";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import {
|
||||
DialogRef,
|
||||
AsyncActionsModule,
|
||||
ButtonModule,
|
||||
DialogModule,
|
||||
SpinnerComponent,
|
||||
} from "@bitwarden/components";
|
||||
import { DialogRef, AsyncActionsModule, ButtonModule, DialogModule } from "@bitwarden/components";
|
||||
import type { chromium_importer } from "@bitwarden/desktop-napi";
|
||||
import { ImportMetadataServiceAbstraction } from "@bitwarden/importer-core";
|
||||
import {
|
||||
@@ -32,7 +26,6 @@ import { DesktopImportMetadataService } from "./desktop-import-metadata.service"
|
||||
AsyncActionsModule,
|
||||
ButtonModule,
|
||||
ImportComponent,
|
||||
SpinnerComponent,
|
||||
],
|
||||
providers: [
|
||||
...ImporterProviders,
|
||||
|
||||
Reference in New Issue
Block a user