mirror of
https://github.com/tloncorp/landscape.git
synced 2024-12-11 09:42:51 +03:00
grid: remove unused kiln/state logic
This commit is contained in:
parent
2c4d8b59bc
commit
59562c54b8
@ -1,4 +1,4 @@
|
||||
import { scryLag, kilnInstall, kilnPause, kilnResume, getPikes, Pikes, Pike, kilnUnsync, kilnSync } from '@urbit/api';
|
||||
import { scryLag, getPikes, Pikes, Pike, kilnUnsync, kilnSync } from '@urbit/api';
|
||||
import create from 'zustand';
|
||||
import produce from 'immer';
|
||||
import { useCallback } from 'react';
|
||||
@ -12,8 +12,6 @@ interface KilnState {
|
||||
lag: boolean;
|
||||
fetchLag: () => Promise<void>;
|
||||
fetchPikes: () => Promise<void>;
|
||||
changeOTASource: (ship: string) => Promise<void>;
|
||||
toggleOTAs: (desk: string, on: boolean) => Promise<void>;
|
||||
toggleSync: (desk: string, ship: string) => Promise<void>;
|
||||
set: (s: KilnState) => void;
|
||||
initializeKiln: () => Promise<void>;
|
||||
@ -35,24 +33,6 @@ const useKilnState = create<KilnState>((set, get) => ({
|
||||
const lag = await api.scry<boolean>(scryLag);
|
||||
set({ lag });
|
||||
},
|
||||
changeOTASource: async (ship: string) => {
|
||||
await api.poke(kilnInstall(ship, 'kids', 'base'));
|
||||
},
|
||||
toggleOTAs: async (desk: string, on: boolean) => {
|
||||
set(
|
||||
produce((draft: KilnState) => {
|
||||
const pike = draft.pikes[desk];
|
||||
if (!pike) {
|
||||
return;
|
||||
}
|
||||
|
||||
pike.zest = on ? 'live' : 'held';
|
||||
})
|
||||
);
|
||||
|
||||
await api.poke(on ? kilnResume(desk) : kilnPause(desk));
|
||||
await get().fetchPikes(); // refresh pikes state
|
||||
},
|
||||
toggleSync: async (desk: string, ship: string) => {
|
||||
const synced = !!get().pikes[desk].sync;
|
||||
await (useMockData
|
||||
|
Loading…
Reference in New Issue
Block a user