From 17f628543068d359a7f61f54861dcfdf914ed2aa Mon Sep 17 00:00:00 2001
From: Liam Fitzgerald
Date: Tue, 14 Sep 2021 23:04:24 +1000
Subject: [PATCH 1/6] btc-wallet: fix webpack output
---
pkg/bitcoin/desk.docket | 2 +-
pkg/btc-wallet/config/webpack.prod.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pkg/bitcoin/desk.docket b/pkg/bitcoin/desk.docket
index 32cd059b55..2dd49e7340 100644
--- a/pkg/bitcoin/desk.docket
+++ b/pkg/bitcoin/desk.docket
@@ -2,7 +2,7 @@
title+'Bitcoin'
info+'BTC wallet for Urbit. Testing'
color+0xf9.8e40
- glob-http+'https://bootstrap.urbit.org/glob-0v2.sl9s6.ud2bs.l9ft0.mstja.5f8kt.glob'
+ glob-http+'https://bootstrap.urbit.org/glob-0v4.ghaim.of1as.9ucee.uj93f.a9nbs.glob'
image+'https://urbit.ewr1.vultrobjects.com/hastuc-dibtux/2021.8.24..02.57.38-bitcoin.svg'
base+'bitcoin'
version+[0 0 1]
diff --git a/pkg/btc-wallet/config/webpack.prod.js b/pkg/btc-wallet/config/webpack.prod.js
index 7f184e5473..fbdbae0590 100644
--- a/pkg/btc-wallet/config/webpack.prod.js
+++ b/pkg/btc-wallet/config/webpack.prod.js
@@ -55,7 +55,7 @@ module.exports = {
filename: (pathData) => {
return pathData.chunk.name === 'app' ? 'index.[contenthash].js' : '[name].js';
},
- path: path.resolve(__dirname, 'dist'),
+ path: path.resolve(__dirname, '../dist'),
publicPath: '/apps/bitcoin/',
},
optimization: {
From 8dd91138431fc84075f9d78b9d9e558565d4151a Mon Sep 17 00:00:00 2001
From: Hunter Miller
Date: Tue, 14 Sep 2021 10:50:39 -0500
Subject: [PATCH 2/6] prefs: hooking up mentions pref
---
pkg/grid/src/app.tsx | 2 +
pkg/grid/src/components/Setting.tsx | 4 +-
pkg/grid/src/components/Toggle.tsx | 7 ++-
.../src/nav/preferences/InterfacePrefs.tsx | 21 ++++---
.../src/nav/preferences/NotificationPrefs.tsx | 12 +++-
pkg/grid/src/state/hark.ts | 55 +++++++++++++++++--
6 files changed, 80 insertions(+), 21 deletions(-)
diff --git a/pkg/grid/src/app.tsx b/pkg/grid/src/app.tsx
index a46304484b..403f5fae20 100644
--- a/pkg/grid/src/app.tsx
+++ b/pkg/grid/src/app.tsx
@@ -8,6 +8,7 @@ import useKilnState from './state/kiln';
import { usePreferencesStore } from './nav/preferences/usePreferencesStore';
import useContactState from './state/contact';
import api from './state/api';
+import { useHarkStore } from './state/hark';
const AppRoutes = () => {
const { push } = useHistory();
@@ -46,6 +47,7 @@ const AppRoutes = () => {
fetchVats();
fetchLag();
useContactState.getState().initialize(api);
+ useHarkStore.getState().initialize(api);
Mousetrap.bind(['command+/', 'ctrl+/'], () => {
push('/leap/search');
diff --git a/pkg/grid/src/components/Setting.tsx b/pkg/grid/src/components/Setting.tsx
index dff93480fc..8dd8803747 100644
--- a/pkg/grid/src/components/Setting.tsx
+++ b/pkg/grid/src/components/Setting.tsx
@@ -20,12 +20,12 @@ export const Setting: FC = ({ name, on, toggle, className, childr
{name} {status === 'loading' && }
-
+
diff --git a/pkg/grid/src/components/Toggle.tsx b/pkg/grid/src/components/Toggle.tsx
index e6d3be2ff7..f9c31beeed 100644
--- a/pkg/grid/src/components/Toggle.tsx
+++ b/pkg/grid/src/components/Toggle.tsx
@@ -6,12 +6,13 @@ import type * as Polymorphic from '@radix-ui/react-polymorphic';
type ToggleComponent = Polymorphic.ForwardRefComponent<
Polymorphic.IntrinsicElement
,
Polymorphic.OwnProps & {
+ toggleClass?: string;
knobClass?: string;
}
>;
export const Toggle = React.forwardRef(
- ({ defaultPressed, pressed, onPressedChange, disabled, className }, ref) => {
+ ({ defaultPressed, pressed, onPressedChange, disabled, className, toggleClass }, ref) => {
const [on, setOn] = useState(defaultPressed);
const isControlled = !!onPressedChange;
const proxyPressed = isControlled ? pressed : on;
@@ -20,14 +21,14 @@ export const Toggle = React.forwardRef(
return (
);
diff --git a/pkg/grid/src/nav/preferences/InterfacePrefs.tsx b/pkg/grid/src/nav/preferences/InterfacePrefs.tsx
index 8824256775..5890ddfc82 100644
--- a/pkg/grid/src/nav/preferences/InterfacePrefs.tsx
+++ b/pkg/grid/src/nav/preferences/InterfacePrefs.tsx
@@ -34,9 +34,7 @@ export function InterfacePrefs() {
<>
Interface Settings
-
- Automatically open urbit links with this urbit
-
+ Automatically open urbit links with this urbit
>
);
diff --git a/pkg/grid/src/nav/preferences/NotificationPrefs.tsx b/pkg/grid/src/nav/preferences/NotificationPrefs.tsx
index 3e62175dd2..ea65bab3ea 100644
--- a/pkg/grid/src/nav/preferences/NotificationPrefs.tsx
+++ b/pkg/grid/src/nav/preferences/NotificationPrefs.tsx
@@ -36,14 +36,7 @@ export const NotificationPrefs = () => {
-
- [PLACEHOLDER] Block visual desktop notifications whenever Urbit software produces an
- in-Landscape notification badge.
-
-
- Turning this "off" will prompt your browser to ask if you'd like to
- enable notifications
-
+ Notify me if someone mentions my @p in a channel I've joined
>
diff --git a/pkg/grid/src/nav/preferences/SystemUpdatePrefs.tsx b/pkg/grid/src/nav/preferences/SystemUpdatePrefs.tsx
index 31339bdce1..07252172ff 100644
--- a/pkg/grid/src/nav/preferences/SystemUpdatePrefs.tsx
+++ b/pkg/grid/src/nav/preferences/SystemUpdatePrefs.tsx
@@ -1,19 +1,30 @@
+import _ from 'lodash';
import React, { ChangeEvent, FormEvent, useCallback, useEffect, useState } from 'react';
import { Button } from '../../components/Button';
import { Setting } from '../../components/Setting';
import { ShipName } from '../../components/ShipName';
import { Spinner } from '../../components/Spinner';
import { useAsyncCall } from '../../logic/useAsyncCall';
-import { usePreferencesStore } from './usePreferencesStore';
+import useKilnState, { useVat } from '../../state/kiln';
export const SystemUpdatePrefs = () => {
- const { otasEnabled, otaSource, toggleOTAs, setOTASource } = usePreferencesStore();
- const [source, setSource] = useState(otaSource);
+ const { changeOTASource, toggleOTAs } = useKilnState((s) =>
+ _.pick(s, ['toggleOTAs', 'changeOTASource'])
+ );
+ const base = useVat('base');
+ const otasEnabled = base && !base.arak.paused;
+ const otaSource = base?.arak.ship;
+
+ const toggleBase = useCallback((on: boolean) => toggleOTAs('base', on), [toggleOTAs]);
+
+ const [source, setSource] = useState('');
const sourceDirty = source !== otaSource;
- const { status: sourceStatus, call: setOTA } = useAsyncCall(setOTASource);
+ const { status: sourceStatus, call: setOTA } = useAsyncCall(changeOTASource);
useEffect(() => {
- setSource(otaSource);
+ if (otaSource) {
+ setSource(otaSource);
+ }
}, [otaSource]);
const handleSourceChange = useCallback((e: ChangeEvent) => {
@@ -34,11 +45,13 @@ export const SystemUpdatePrefs = () => {
<>
System Updates
-
+
Automatically download and apply system updates to keep your Urbit up to date.
-
- OTA Source:
-
+ {otaSource && (
+
+ OTA Source:
+
+ )}