mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-04 05:39:57 -05:00
Handling when settings has yet to be fetched.
This commit is contained in:
parent
ef35885797
commit
6f1431e6e4
1 changed files with 5 additions and 0 deletions
|
|
@ -1632,6 +1632,11 @@ export function fuzzyMatch(a, b, threshold = 3) {
|
|||
export function useIsIgnoredDirectory(directory) {
|
||||
const {settings} = React.useContext(SettingsContext);
|
||||
|
||||
if (!settings || _.isEmpty(settings)) {
|
||||
// Settings have not yet been fetched.
|
||||
return false;
|
||||
}
|
||||
|
||||
let ignoredDirectories = settings['ignored_directories'];
|
||||
if (directory.endsWith('/')) {
|
||||
ignoredDirectories = ignoredDirectories.map(i => `${i}/`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue