Skip to content

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

added loading notification

Ilian Sapundshieva750fb1aed50
diff --git a/app/components/FolderContainer.js b/app/components/FolderContainer.js
index eabf50852..b4ec828e0 100644
--- a/app/components/FolderContainer.js
+++ b/app/components/FolderContainer.js
@@ -106,7 +106,7 @@ const styles = theme => ({
});
function Loading() {
- return <Typography style={{ padding: 10 }}>Loading...</Typography>;
+ return <Typography style={{ padding: 10 }}>{i18n.t('core:loading')}</Typography>;
}
const GridPerspective = Loadable({
diff --git a/app/locales/en/core.json b/app/locales/en/core.json
index 449377f9a..4a29b4afe 100644
--- a/app/locales/en/core.json
+++ b/app/locales/en/core.json
@@ -350,6 +350,8 @@
"tagDelimiterComma": "comma (,)",
"maxSearchResultChoose": "Max Search Results",
"releaseToDrop": "Drop files to import them...",
- "releaseToMoveDrop": "Move files here..",
+ "releaseToMoveDrop": "Move files here...",
+ "loading": "Loading...",
+ "cancelEditing": "Cancel editing",
"-": "-"
}
diff --git a/app/reducers/app.js b/app/reducers/app.js
index fc5507744..39d6f1293 100644
--- a/app/reducers/app.js
+++ b/app/reducers/app.js
@@ -527,6 +527,7 @@ export const actions = {
console.time('listDirectoryPromise');
const { settings } = getState();
window.walkCanceled = false;
+ dispatch(actions.showNotification(i18n.t('core:loading'), 'info', false));
PlatformIO.listDirectoryPromise(directoryPath, false)
.then(results => {
const metaDirectory = getMetaDirectoryPath(directoryPath);
@@ -604,6 +605,15 @@ export const actions = {
loadDirectorySuccess: (
directoryPath: string,
directoryContent: Array<Object>
+ ) => (
+ dispatch: (actions: Object) => void
+ ) => {
+ dispatch(actions.hideNotifications());
+ dispatch(actions.loadDirectorySuccessInt(directoryPath, directoryContent));
+ },
+ loadDirectorySuccessInt: (
+ directoryPath: string,
+ directoryContent: Array<Object>
) => ({
type: types.LOAD_DIRECTORY_SUCCESS,
directoryPath,
@@ -613,6 +623,7 @@ export const actions = {
dispatch: (actions: Object) => void
) => {
console.warn('Error loading directory: ' + error);
+ dispatch(actions.hideNotifications());
dispatch(
actions.showNotification('Error loading directory', 'warning', true)
);