Skip to content

TagSpaces is an offline, open source, document manager with tagging support

UI fixes settings and locations (#1383)

Ilian2565c165b429
diff --git a/app/components/LocationView.tsx b/app/components/LocationView.tsx
index 75fbfd42e..71a2f20a4 100644
--- a/app/components/LocationView.tsx
+++ b/app/components/LocationView.tsx
@@ -20,6 +20,7 @@ import React, { useRef, useState } from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { withStyles } from '@material-ui/core/styles';
+import Tooltip from '@material-ui/core/Tooltip';
import ListItem from '@material-ui/core/ListItem';
import ListItemIcon from '@material-ui/core/ListItemIcon';
import ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';
@@ -225,13 +226,7 @@ const LocationView = React.memo((props: Props) => {
? props.classes.listItemSelected
: props.classes.listItem
}
- title={
- location.isDefault
- ? i18n.t('core: thisIsStartupLocation') +
- ' : ' +
- getLocationPath(location)
- : getLocationPath(location)
- }
+ title={getLocationPath(location)}
button
onClick={() => handleLocationClick()}
onContextMenu={event => handleLocationContextMenuClick(event)}
@@ -308,7 +303,9 @@ const LocationView = React.memo((props: Props) => {
onContextMenu={event => handleLocationContextMenuClick(event)}
>
{location.isDefault && (
- <DefaultLocationIcon data-tid="startupIndication" />
+ <Tooltip title={i18n.t('core:thisIsStartupLocation')}>
+ <DefaultLocationIcon data-tid="startupIndication" />
+ </Tooltip>
)}
<MoreVertIcon />
</IconButton>
diff --git a/app/components/dialogs/settings/SettingsGeneral.tsx b/app/components/dialogs/settings/SettingsGeneral.tsx
index 90b38e879..c38506a68 100644
--- a/app/components/dialogs/settings/SettingsGeneral.tsx
+++ b/app/components/dialogs/settings/SettingsGeneral.tsx
@@ -116,7 +116,15 @@ const SettingsGeneral = (props: Props) => {
<Select
data-tid="settingsSetLanguage"
value={props.settings.interfaceLanguage}
- onChange={(event: any) => props.setLanguage(event.target.value)}
+ onChange={(event: any) => {
+ props.setLanguage(event.target.value);
+ const { currentTheme } = props.settings;
+ const newTheme = currentTheme === 'dark' ? 'light' : 'dark';
+ props.setCurrentTheme(newTheme);
+ setTimeout(() => {
+ props.setCurrentTheme(currentTheme);
+ }, 500);
+ }}
input={<Input id="languageSelector" />}
>
{props.settings.supportedLanguages.map(language => (
@@ -380,7 +388,7 @@ const SettingsGeneral = (props: Props) => {
<Button
data-tid="reloadAppTID"
onClick={() => {
- location.reload();
+ window.location.reload();
}}
color="secondary"
>