Skip to content
Snippets Groups Projects
Unverified Commit c007c3f6 authored by Jed Fox's avatar Jed Fox
Browse files

Make useServerURL a named export

parent d90559a6
No related branches found
No related tags found
No related merge requests found
......@@ -10,7 +10,7 @@ import {
Menu
} from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style';
import useServerURL from '../hooks/useServerURL';
import { useServerURL } from '../hooks/useServerURL';
function LoggedInUser({
files,
......
......@@ -11,7 +11,7 @@ import { colors } from 'loot-design/src/style';
import { signOut, loggedIn } from 'loot-core/src/client/actions/user';
import { send } from 'loot-core/src/platform/client/fetch';
import { Title, Input } from './subscribe/common';
import useServerURL from '../../hooks/useServerURL';
import { useServerURL } from '../../hooks/useServerURL';
export default function ConfigServer() {
let dispatch = useDispatch();
......
import React from 'react';
import { View, Text, AnchorLink } from 'loot-design/src/components/common';
import useServerURL from '../../hooks/useServerURL';
import { useServerURL } from '../../hooks/useServerURL';
export default function ServerURL() {
const url = useServerURL();
......
import { useState, useEffect } from 'react';
import { send } from 'loot-core/src/platform/client/fetch';
function useServerURL() {
export function useServerURL() {
let [url, setUrl] = useState('');
useEffect(() => {
async function run() {
let url = await send('get-server-url') || '';
let url = (await send('get-server-url')) || '';
if (url === 'https://not-configured/') {
url = '';
}
......@@ -15,5 +15,3 @@ function useServerURL() {
}, []);
return url;
}
export default useServerURL;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment