Skip to content

Commit

Permalink
OK-22356 fix:exit App. (#3403)
Browse files Browse the repository at this point in the history
  • Loading branch information
linleiqin authored Aug 15, 2023
1 parent 11adbe4 commit edf2e8b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
5 changes: 2 additions & 3 deletions packages/kit-bg/src/services/ServiceApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ import {
AppEventBusNames,
appEventBus,
} from '@onekeyhq/shared/src/eventBus/appEventBus';
import { exitApp } from '@onekeyhq/shared/src/exitApp';
import debugLogger from '@onekeyhq/shared/src/logger/debugLogger';
import RNExitApp from '@onekeyhq/shared/src/modules3rdParty/react-native-exit-app';
import platformEnv from '@onekeyhq/shared/src/platformEnv';
import appStorage from '@onekeyhq/shared/src/storage/appStorage';
import timerUtils from '@onekeyhq/shared/src/utils/timerUtils';
Expand Down Expand Up @@ -167,8 +167,7 @@ class ServiceApp extends ServiceBase {
@backgroundMethod()
exitApp() {
if (platformEnv.isNative) {
if (!RNExitApp) return;
return RNExitApp.exitApp();
exitApp();
}
}

Expand Down
5 changes: 5 additions & 0 deletions packages/shared/src/exitApp/index.native.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import RNExitApp from 'react-native-exit-app';

export function exitApp() {
return RNExitApp.exitApp();
}
1 change: 1 addition & 0 deletions packages/shared/src/exitApp/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export function exitApp() {}

This file was deleted.

This file was deleted.

0 comments on commit edf2e8b

Please sign in to comment.