Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

suplement: fix reload for update button #166

Merged
merged 3 commits into from
Jan 5, 2022
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
4 changes: 0 additions & 4 deletions web/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ html, body {
min-height: 100vh;
}

.ant-layout-header {
padding: 0 30px !important;
}

.container {
min-height: 79vh;
padding: 24px 12px;
Expand Down
6 changes: 5 additions & 1 deletion web/src/pages/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import React, { useEffect, useState } from 'react'
import { useHistory } from 'react-router-dom'
import useSWRImmutable from 'swr/immutable'
import { apiUrl, fetcher, req } from '../utils/Fetcher'
import * as serviceWorkerRegistration from '../serviceWorkerRegistration'

interface Props {
me?: any,
Expand Down Expand Up @@ -88,7 +89,10 @@ const Settings: React.FC<Props> = ({ me, mutate, error }) => {
}} checked={me?.user.settings?.theme === 'dark'} defaultChecked={me?.user.settings?.theme === 'dark'} />
</Form.Item>
<Form.Item label="Check Updates">
<Button shape="round" icon={<ReloadOutlined />} onClick={() => (window.location as any).reload(true)}>Reload</Button>
<Button shape="round" icon={<ReloadOutlined />} onClick={() => {
serviceWorkerRegistration.unregister();
(window.location as any).reload(true)
}}>Reload</Button>
</Form.Item>
<Form.Item label={<Typography.Text type="danger">Delete Account</Typography.Text>}>
<Button shape="round" danger type="primary" icon={<FrownOutlined />} onClick={() => setRemoveConfirmation(true)}>Delete</Button>
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const Navbar: React.FC<Props> = ({ user }) => {
}

return <>
<Layout.Header style={{ background: user?.settings?.theme === 'dark' ? '#1f1f1f' : '#0088CC' }}>
<Layout.Header style={{ background: user?.settings?.theme === 'dark' ? '#1f1f1f' : '#0088CC', padding: '0 30px' }}>
<div key="logo" className="logo" style={{ marginRight: '30px' }}>
<Link to="/" style={{ color: '#fff' }}>
<img src="/teledrive-logo/logoteledrive-white.png" style={{ height: '24px' }} /> {user?.plan === 'premium' && <Popover placement="bottom" content={<Layout style={{ padding: '7px 13px' }}>Premium</Layout>}>
Expand Down