Skip to content

Commit 6baa8e8

Browse files
author
Garrett Downs
committed
refactor(kaios): rename volume property and functions
1 parent 4272003 commit 6baa8e8

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/components/AppMenu.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,9 @@ export function AppMenu(props: AppMenuProps): h.JSX.Element {
406406
/>
407407
<ControllerOption
408408
label="Volume"
409-
leftAction={() => KaiOS.system.volumeDown()}
410-
rightAction={() => KaiOS.system.volumeUp()}
411-
centerAction={() => KaiOS.system.volumeShow()}
409+
leftAction={() => KaiOS.volume.down()}
410+
rightAction={() => KaiOS.volume.up()}
411+
centerAction={() => KaiOS.volume.show()}
412412
selectable={{
413413
priority: SelectablePriority.Medium,
414414
id: 'volume',

src/components/FoxcastsAppMenu.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,9 @@ export function FoxcastsAppMenu(props: FoxcastsAppMenuProps): h.JSX.Element {
402402
/>
403403
<ControllerOption
404404
label="Volume"
405-
leftAction={() => KaiOS.system.volumeDown()}
406-
rightAction={() => KaiOS.system.volumeUp()}
407-
centerAction={() => KaiOS.system.volumeShow()}
405+
leftAction={() => KaiOS.volume.down()}
406+
rightAction={() => KaiOS.volume.up()}
407+
centerAction={() => KaiOS.volume.show()}
408408
selectable={{
409409
priority: SelectablePriority.Medium,
410410
id: 'volume',

src/routes/Player.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ export default function Player({ tabId }: Props): VNode {
137137

138138
useNavKeys(
139139
{
140-
ArrowUp: () => KaiOS.system.volumeUp(),
141-
ArrowDown: () => KaiOS.system.volumeDown(),
140+
ArrowUp: () => KaiOS.volume.up(),
141+
ArrowDown: () => KaiOS.volume.down(),
142142
},
143143
{ disabled: tabId !== 'player' || view.appbarOpen || view.homeMenuOpen }
144144
);

src/services/kaios.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ export class KaiOS {
106106
this.navigator.getDeviceStorage(storageName)?.storageName,
107107
};
108108

109-
static system = {
110-
volumeUp: () => this.navigator.volumeManager.requestUp(),
111-
volumeDown: () => this.navigator.volumeManager.requestDown(),
112-
volumeShow: () => this.navigator.volumeManager.requestShow(),
109+
static volume = {
110+
up: () => this.navigator.volumeManager.requestUp(),
111+
down: () => this.navigator.volumeManager.requestDown(),
112+
show: () => this.navigator.volumeManager.requestShow(),
113113
};
114114

115115
static battery = this.navigator.battery || {

0 commit comments

Comments
 (0)