mirror of
https://github.com/yume-chan/ya-webadb.git
synced 2025-10-06 03:50:18 +02:00
chore: fix build warnings
This commit is contained in:
parent
4d01f25124
commit
f494d80166
4 changed files with 12 additions and 6 deletions
|
@ -45,11 +45,7 @@ module.exports = withMDX({
|
|||
// https://github.com/vercel/next.js/pull/7550#issuecomment-512861158
|
||||
// https://github.com/vercel/next.js/issues/12861
|
||||
exclude: [
|
||||
/@next\/react-dev-overlay/,
|
||||
/@next\/react-refresh-utils\/runtime.js$/,
|
||||
/@next\/react-refresh-utils\/internal\/helpers.js$/,
|
||||
/next\/dist\/build\/polyfills\/unfetch.js$/,
|
||||
/next\/dist\/build\/polyfills\/unfetch.js$/,
|
||||
/next/,
|
||||
],
|
||||
use: ['source-map-loader'],
|
||||
enforce: 'pre',
|
||||
|
|
|
@ -203,7 +203,6 @@ function _Connect(): JSX.Element | null {
|
|||
const disconnect = useCallback(async () => {
|
||||
try {
|
||||
await GlobalState.device!.close();
|
||||
GlobalState.setDevice(undefined, undefined);
|
||||
} catch (e: any) {
|
||||
GlobalState.showErrorDialog(e);
|
||||
}
|
||||
|
|
|
@ -39,6 +39,10 @@ const state = makeAutoObservable({
|
|||
});
|
||||
|
||||
autorun(() => {
|
||||
if (!terminal) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GlobalState.device) {
|
||||
terminal.socket = undefined;
|
||||
return;
|
||||
|
|
|
@ -267,6 +267,13 @@ export class Adb implements Closeable {
|
|||
return framebuffer(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the ADB connection.
|
||||
*
|
||||
* Note that it won't close the streams from backends.
|
||||
* The streams are both physically and logically intact,
|
||||
* and can be reused.
|
||||
*/
|
||||
public async close(): Promise<void> {
|
||||
await this.dispatcher.close();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue