Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server #42

Merged
merged 7 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions packages/008/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ appInsights.trackPageView();

export default function App() {
const store = useStore();
const { settingsUri, toggleShowSettings } = store;
const { settingsUri, toggleShowSettings, server, showSettings } = store;

useEffect(() => {
const mustSettings = !settingsUri;
Expand Down Expand Up @@ -55,8 +55,11 @@ export default function App() {
>
<ContextProvider>
<Container>
<PhoneScreen />
<SettingsScreen />
{!server && <PhoneScreen />}
<SettingsScreen
closeable={!server}
visible={showSettings || server}
/>
</Container>
</ContextProvider>
</AppInsightsErrorBoundary>
Expand Down
18 changes: 14 additions & 4 deletions packages/008/src/screens/SettingsScreen.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -312,12 +312,21 @@ export const QView = () => {

qTts,
qSummarization,
events
events,

server
} = store;

return (
<View style={{ flex: 1 }}>
<Title>008Q</Title>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', padding: 5 }}>
<Text>Server Only</Text>
<Switch value={server} onValueChange={(val) => setSettings({ server: val })} />
</View>

<HRule />

<View style={{ flexDirection: 'row', justifyContent: 'space-between', padding: 5 }}>
<Text>Transcribe</Text>
<Switch value={qTts} onValueChange={() => {
Expand All @@ -337,7 +346,7 @@ export const QView = () => {
)
}

export const SettingsScreen = ({ visible = false, closeable = true, server = false }) => {
export const SettingsScreen = ({ visible = false, closeable = true }) => {
const store = useStore();
const {
settingsUri,
Expand All @@ -346,11 +355,12 @@ export const SettingsScreen = ({ visible = false, closeable = true, server = fal
login,

setSettings,
showSettings,
toggleShowSettings,
settingsTab = 'user',

webhooks,

server,
} = store;

const [option, setOption] = useState(settingsTab);
Expand Down Expand Up @@ -461,7 +471,7 @@ export const SettingsScreen = ({ visible = false, closeable = true, server = fal
return (
<Screen
closeable={closeable}
visible={visible || showSettings}
visible={visible}
onClose={toggleShowSettings}
>
<View style={{ flex: 1, flexDirection: 'row' }}>
Expand Down
4 changes: 3 additions & 1 deletion packages/008/src/store/Context.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ const DEFAULTS = {
qSummarization: false,
events: [],

size: { width: 340, height: 460 }
size: { width: 340, height: 460 },

server: false
};

const DEFAULTS_NOCONFIG = {
Expand Down