mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
+11
-1
@@ -4,6 +4,7 @@ import App from './App';
|
||||
import { HelmetProvider } from 'react-helmet-async';
|
||||
import { HashRouter } from 'react-router-dom';
|
||||
import * as serviceWorkerRegistration from './serviceWorkerRegistration';
|
||||
import { App as CapacitorApp } from '@capacitor/app';
|
||||
|
||||
import PlebbitJs from '@plebbit/plebbit-js';
|
||||
// inject native functions into renderer
|
||||
@@ -24,4 +25,13 @@ root.render(
|
||||
);
|
||||
|
||||
// set up PWA https://cra.link/PWA
|
||||
serviceWorkerRegistration.register();
|
||||
serviceWorkerRegistration.register();
|
||||
|
||||
// add back button in android app
|
||||
CapacitorApp.addListener('backButton', ({canGoBack}) => {
|
||||
if (canGoBack) {
|
||||
window.history.back();
|
||||
} else {
|
||||
CapacitorApp.exitApp();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user