mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Fetching tags globally every 30 seconds, rather than for each usage of Tags.
This commit is contained in:
parent
e9f820d483
commit
7a855b57cc
8 changed files with 30 additions and 41 deletions
|
|
@ -43,7 +43,7 @@ import _ from "lodash";
|
|||
import {ThemeContext} from "../contexts/contexts";
|
||||
import {Button, Card, CardIcon, Header, Loader, Placeholder, Segment} from "./Theme";
|
||||
import {SortableTable} from "./SortableTable";
|
||||
import {taggedImageLabel, TagsProvider, TagsSelector} from "../Tags";
|
||||
import {taggedImageLabel, TagsSelector} from "../Tags";
|
||||
|
||||
function ArchivePage() {
|
||||
const [deleteOpen, setDeleteOpen] = useState(false);
|
||||
|
|
@ -173,9 +173,7 @@ function ArchivePage() {
|
|||
</Segment>
|
||||
|
||||
<Segment>
|
||||
<TagsProvider>
|
||||
<TagsSelector selectedTagNames={archiveFile['tags']} onAdd={localAddTag} onRemove={localRemoveTag}/>
|
||||
</TagsProvider>
|
||||
<TagsSelector selectedTagNames={archiveFile['tags']} onAdd={localAddTag} onRemove={localRemoveTag}/>
|
||||
</Segment>
|
||||
|
||||
<Segment>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import {ThemeContext} from "../contexts/contexts";
|
|||
import {Accordion, Button, Form, FormField, FormGroup, FormInput, Header, Loader, Segment, TextArea} from "./Theme";
|
||||
import {AccordionContent, AccordionTitle, FormDropdown} from "semantic-ui-react";
|
||||
import {Link} from "react-router-dom";
|
||||
import {TagsProvider, TagsSelector} from "../Tags";
|
||||
import {TagsSelector} from "../Tags";
|
||||
|
||||
const validUrl = /^(http|https):\/\/[^ "]+$/;
|
||||
|
||||
|
|
@ -105,9 +105,7 @@ class Downloader extends React.Component {
|
|||
|
||||
let tagsSelector;
|
||||
if (withTags) {
|
||||
tagsSelector = <TagsProvider>
|
||||
<TagsSelector selectedTagNames={tagNames} onToggle={this.handleSelectedTags}/>
|
||||
</TagsProvider>;
|
||||
tagsSelector = <TagsSelector selectedTagNames={tagNames} onToggle={this.handleSelectedTags}/>;
|
||||
}
|
||||
|
||||
const advancedAccordion = <Accordion>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import {
|
|||
ModalContent,
|
||||
ModalHeader
|
||||
} from "semantic-ui-react";
|
||||
import {TagsProvider, TagsSelector} from "../Tags";
|
||||
import {TagsSelector} from "../Tags";
|
||||
import {Media} from "../contexts/contexts";
|
||||
import {encodeMediaPath} from "./Common";
|
||||
import {addTag, fetchFile, removeTag} from "../api";
|
||||
|
|
@ -201,9 +201,8 @@ export function FilePreviewWrapper({children}) {
|
|||
openButton = <SButton color='blue' as='a' href={url}>Open</SButton>;
|
||||
}
|
||||
const closeButton = <SButton onClick={handleClose}>Close</SButton>;
|
||||
const tagsDisplay = <TagsProvider>
|
||||
<TagsSelector selectedTagNames={previewFile['tags']} onAdd={localAddTag} onRemove={localRemoveTag}/>
|
||||
</TagsProvider>;
|
||||
const tagsDisplay = <TagsSelector selectedTagNames={previewFile['tags']} onAdd={localAddTag}
|
||||
onRemove={localRemoveTag}/>;
|
||||
let downloadButton;
|
||||
if (downloadURL) {
|
||||
downloadButton = <SButton color='yellow' as='a' href={downloadURL} floated='left'>
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ import _ from 'lodash';
|
|||
import {FileBrowser} from "./FileBrowser";
|
||||
import {refreshDirectoryFiles, refreshFiles} from "../api";
|
||||
import {useSubscribeEventName} from "../Events";
|
||||
import {TagsContext, TagsDropdown, TagsProvider} from "../Tags";
|
||||
import {TagsDropdown} from "../Tags";
|
||||
|
||||
function EbookCard({file}) {
|
||||
const {s} = useContext(ThemeContext);
|
||||
|
|
@ -347,9 +347,7 @@ export function FilesView({
|
|||
{selectButton}
|
||||
{viewButton}
|
||||
{limitDropdown}
|
||||
<TagsProvider>
|
||||
<TagsFilesGroupDropdown/>
|
||||
</TagsProvider>
|
||||
<TagsFilesGroupDropdown/>
|
||||
{filterOptions && filtersDropdown}
|
||||
</Grid.Column>
|
||||
{menuColumns}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import {useChannel} from "../hooks/customHooks";
|
|||
import {ThemeContext} from "../contexts/contexts";
|
||||
import {Button, darkTheme, Header, Icon, Segment, Tab, TabPane} from "./Theme";
|
||||
import {VideoCard} from "./Videos";
|
||||
import {TagsProvider, TagsSelector} from "../Tags";
|
||||
import {TagsSelector} from "../Tags";
|
||||
|
||||
const MEDIA_PATH = '/media';
|
||||
|
||||
|
|
@ -221,9 +221,7 @@ function VideoPage({videoFile, prevFile, nextFile, fetchVideo, ...props}) {
|
|||
</Segment>
|
||||
|
||||
<Segment>
|
||||
<TagsProvider>
|
||||
<TagsSelector selectedTagNames={videoFile['tags']} onAdd={localAddTag} onRemove={localRemoveTag}/>
|
||||
</TagsProvider>
|
||||
<TagsSelector selectedTagNames={videoFile['tags']} onAdd={localAddTag} onRemove={localRemoveTag}/>
|
||||
</Segment>
|
||||
|
||||
<Tab menu={tabMenu} panes={tabPanes}/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue