Skip to content

Commit

Permalink
fix installer not starting
Browse files Browse the repository at this point in the history
  • Loading branch information
DerGoogler committed Sep 18, 2024
1 parent 6a5bc33 commit d6ab389
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions src/activitys/InstallTerminalV2Activity/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,6 @@ const InstallerComponent = () => {

const { clearTerminal, lines } = useLines();

// ensure that it is always the same function
const nativeVolumeEventPrevent = React.useCallback((e: Event) => {
e.preventDefault();
}, []);
React.useEffect(() => {
document.addEventListener("volumeupbutton", nativeVolumeEventPrevent, false);
document.addEventListener("volumedownbutton", nativeVolumeEventPrevent, false);
view.addFlags([WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON]);
return () => {
document.removeEventListener("volumeupbutton", nativeVolumeEventPrevent, false);
document.removeEventListener("volumedownbutton", nativeVolumeEventPrevent, false);
view.clearFlags([WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON]);
};
}, []);

const [termScrollBottom] = useSettings("term_scroll_bottom");
const [termScrollBehavior] = useSettings("term_scroll_behavior");

Expand Down Expand Up @@ -88,15 +73,27 @@ const InstallerComponent = () => {
}
}, []);

const install = () => {
// ensure that it is always the same function
const nativeVolumeEventPrevent = React.useCallback((e: Event) => {
e.preventDefault();
}, []);
React.useEffect(() => {
const { exploreInstall } = extra;

if (exploreInstall) {
handleExploreInstall();
} else {
handleLocalInstall();
}
};

document.addEventListener("volumeupbutton", nativeVolumeEventPrevent, false);
document.addEventListener("volumedownbutton", nativeVolumeEventPrevent, false);
view.addFlags([WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON]);
return () => {
document.removeEventListener("volumeupbutton", nativeVolumeEventPrevent, false);
document.removeEventListener("volumedownbutton", nativeVolumeEventPrevent, false);
view.clearFlags([WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON]);
};
}, []);

const renderToolbar = () => {
return (
Expand Down Expand Up @@ -129,7 +126,6 @@ const InstallerComponent = () => {
// removing bottom window insets
pb: "0px !important",
}}
onShow={install}
modifier="noshadow"
renderToolbar={renderToolbar}
>
Expand Down

0 comments on commit d6ab389

Please sign in to comment.