mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-28 10:33:02 -05:00
Make useServerURL a named export
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
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();
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user