Skip to content

Commit

Permalink
refactor(web): drop the old client installer
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Sep 24, 2024
1 parent 6bab21d commit d604230
Show file tree
Hide file tree
Showing 15 changed files with 12 additions and 6,373 deletions.
200 changes: 0 additions & 200 deletions web/src/client/dbus.js

This file was deleted.

88 changes: 0 additions & 88 deletions web/src/client/dbus.test.js

This file was deleted.

12 changes: 0 additions & 12 deletions web/src/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,10 @@

// @ts-check

import { L10nClient } from "./l10n";
import { ManagerClient } from "./manager";
import { StorageClient } from "./storage";
import { HTTPClient } from "./http";

/**
* @typedef {object} InstallerClient
* @property {L10nClient} l10n - localization client.
* @property {ManagerClient} manager - manager client.
* @property {StorageClient} storage - storage client.
* @property {() => import("./http").WSClient} ws - Agama WebSocket client.
* @property {() => boolean} isConnected - determines whether the client is connected
* @property {() => boolean} isRecoverable - determines whether the client is recoverable after disconnected
Expand All @@ -49,18 +43,12 @@ import { HTTPClient } from "./http";
*/
const createClient = (url) => {
const client = new HTTPClient(url);
const l10n = new L10nClient(client);
// TODO: unify with the manager client
const manager = new ManagerClient(client);
const storage = new StorageClient(client);

const isConnected = () => client.ws().isConnected() || false;
const isRecoverable = () => !!client.ws().isRecoverable();

return {
l10n,
manager,
storage,
isConnected,
isRecoverable,
onConnect: (handler) => client.ws().onOpen(handler),
Expand Down
Loading

0 comments on commit d604230

Please sign in to comment.