Skip to content

Commit edf2e8b

Browse files
authored
OK-22356 fix:exit App. (#3403)
1 parent 11adbe4 commit edf2e8b

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

packages/kit-bg/src/services/ServiceApp.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ import {
4949
AppEventBusNames,
5050
appEventBus,
5151
} from '@onekeyhq/shared/src/eventBus/appEventBus';
52+
import { exitApp } from '@onekeyhq/shared/src/exitApp';
5253
import debugLogger from '@onekeyhq/shared/src/logger/debugLogger';
53-
import RNExitApp from '@onekeyhq/shared/src/modules3rdParty/react-native-exit-app';
5454
import platformEnv from '@onekeyhq/shared/src/platformEnv';
5555
import appStorage from '@onekeyhq/shared/src/storage/appStorage';
5656
import timerUtils from '@onekeyhq/shared/src/utils/timerUtils';
@@ -167,8 +167,7 @@ class ServiceApp extends ServiceBase {
167167
@backgroundMethod()
168168
exitApp() {
169169
if (platformEnv.isNative) {
170-
if (!RNExitApp) return;
171-
return RNExitApp.exitApp();
170+
exitApp();
172171
}
173172
}
174173

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import RNExitApp from 'react-native-exit-app';
2+
3+
export function exitApp() {
4+
return RNExitApp.exitApp();
5+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export function exitApp() {}

packages/shared/src/modules3rdParty/react-native-exit-app/index.native.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/shared/src/modules3rdParty/react-native-exit-app/index.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)