Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 35600316 authored by Simon Chan's avatar Simon Chan
Browse files

fix(demo): start Scrcpy

fixes #476
parent 4c3680eb
Loading
Loading
Loading
Loading
+34 −22
Original line number Diff line number Diff line
@@ -27,7 +27,13 @@ import {
import { TinyH264Decoder } from "@yume-chan/scrcpy-decoder-tinyh264";
import SCRCPY_SERVER_VERSION from "@yume-chan/scrcpy/bin/version";
import { WritableStream } from "@yume-chan/stream-extra";
import { autorun, computed, makeAutoObservable, runInAction } from "mobx";
import {
    autorun,
    computed,
    makeAutoObservable,
    observable,
    runInAction,
} from "mobx";
import { observer } from "mobx-react-lite";
import { GLOBAL_STATE } from "../../state";
import { Icons } from "../../utils";
@@ -191,7 +197,8 @@ export interface DecoderDefinition {
    Constructor: H264DecoderConstructor;
}

export const SETTING_STATE = makeAutoObservable({
export const SETTING_STATE = makeAutoObservable(
    {
        settingsVisible: false,

        displays: [] as number[],
@@ -212,7 +219,12 @@ export const SETTING_STATE = makeAutoObservable({
            crop: "",
            powerOn: true,
        } as Settings,
});
    },
    {
        decoders: observable.shallow,
        settings: observable.deep,
    }
);

autorun(() => {
    if (GLOBAL_STATE.device) {