diff --git a/browser/app/js/alert/actions.js b/browser/app/js/alert/actions.js
index 3ce11661d..a04f69eb0 100644
--- a/browser/app/js/alert/actions.js
+++ b/browser/app/js/alert/actions.js
@@ -22,7 +22,7 @@ export let alertId = 0
export const set = alert => {
const id = alertId++
return (dispatch, getState) => {
- if (alert.type !== "danger") {
+ if (alert.type !== "danger" || alert.autoClear) {
setTimeout(() => {
dispatch({
type: CLEAR,
diff --git a/browser/app/js/objects/__tests__/actions.test.js b/browser/app/js/objects/__tests__/actions.test.js
index fb48b1dbc..1cab87e62 100644
--- a/browser/app/js/objects/__tests__/actions.test.js
+++ b/browser/app/js/objects/__tests__/actions.test.js
@@ -123,9 +123,6 @@ describe("Objects actions", () => {
objects: { currentPrefix: "" }
})
const expectedActions = [
- {
- type: "alert/CLEAR"
- },
{
type: "objects/SET_LIST",
objects: [{ name: "test1" }, { name: "test2" }],
@@ -157,9 +154,6 @@ describe("Objects actions", () => {
objects: { currentPrefix: "" }
})
const expectedActions = [
- {
- type: "alert/CLEAR"
- },
{
type: "objects/APPEND_LIST",
objects: [{ name: "test1" }, { name: "test2" }],
@@ -183,15 +177,13 @@ describe("Objects actions", () => {
objects: { currentPrefix: "" }
})
const expectedActions = [
- {
- type: "alert/CLEAR"
- },
{
type: "alert/SET",
alert: {
type: "danger",
message: "listobjects is denied",
- id: alertActions.alertId
+ id: alertActions.alertId,
+ autoClear: true
}
},
{
@@ -252,7 +244,6 @@ describe("Objects actions", () => {
})
const expectedActions = [
{ type: "objects/SET_CURRENT_PREFIX", prefix: "abc/" },
- { type: "alert/CLEAR" },
{ type: "objects/CHECKED_LIST_RESET" }
]
store.dispatch(actionsObjects.selectPrefix("abc/"))
diff --git a/browser/app/js/objects/actions.js b/browser/app/js/objects/actions.js
index c4d2a3e2f..3268ecde7 100644
--- a/browser/app/js/objects/actions.js
+++ b/browser/app/js/objects/actions.js
@@ -64,43 +64,47 @@ export const fetchObjects = append => {
buckets: { currentBucket },
objects: { currentPrefix, marker }
} = getState()
- dispatch(alertActions.clear())
if (currentBucket) {
return web
- .ListObjects({
- bucketName: currentBucket,
- prefix: currentPrefix,
- marker: append ? marker : ""
- })
- .then(res => {
- let objects = []
- if (res.objects) {
- objects = res.objects.map(object => {
- return {
- ...object,
- name: object.name.replace(currentPrefix, "")
- }
- })
- }
- if (append) {
- dispatch(appendList(objects, res.nextmarker, res.istruncated))
- } else {
- dispatch(setList(objects, res.nextmarker, res.istruncated))
- dispatch(setSortBy(""))
- dispatch(setSortOrder(false))
- }
- dispatch(setPrefixWritable(res.writable))
- })
- .catch(err => {
- if (web.LoggedIn()) {
- dispatch(alertActions.set({ type: "danger", message: err.message }))
- dispatch(resetList())
- }
- else {
- history.push("/login")
- }
- })
- }
+ .ListObjects({
+ bucketName: currentBucket,
+ prefix: currentPrefix,
+ marker: append ? marker : ""
+ })
+ .then(res => {
+ let objects = []
+ if (res.objects) {
+ objects = res.objects.map(object => {
+ return {
+ ...object,
+ name: object.name.replace(currentPrefix, "")
+ }
+ })
+ }
+ if (append) {
+ dispatch(appendList(objects, res.nextmarker, res.istruncated))
+ } else {
+ dispatch(setList(objects, res.nextmarker, res.istruncated))
+ dispatch(setSortBy(""))
+ dispatch(setSortOrder(false))
+ }
+ dispatch(setPrefixWritable(res.writable))
+ })
+ .catch(err => {
+ if (web.LoggedIn()) {
+ dispatch(
+ alertActions.set({
+ type: "danger",
+ message: err.message,
+ autoClear: true
+ })
+ )
+ dispatch(resetList())
+ } else {
+ history.push("/login")
+ }
+ })
+ }
}
}
diff --git a/browser/ui-assets.go b/browser/ui-assets.go
index 8b117bdc2..f016508f3 100644
--- a/browser/ui-assets.go
+++ b/browser/ui-assets.go
@@ -4,7 +4,7 @@
// production/favicon.ico
// production/firefox.png
// production/index.html
-// production/index_bundle-2018-09-13T07-05-02Z.js
+// production/index_bundle-2018-09-20T05-24-40Z.js
// production/loader.css
// production/logo.svg
// production/safari.png
@@ -65,7 +65,7 @@ func productionChromePng() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "production/chrome.png", size: 3726, mode: os.FileMode(420), modTime: time.Unix(1536822319, 0)}
+ info := bindataFileInfo{name: "production/chrome.png", size: 3726, mode: os.FileMode(420), modTime: time.Unix(1537421095, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -82,7 +82,7 @@ func productionFaviconIco() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "production/favicon.ico", size: 501, mode: os.FileMode(420), modTime: time.Unix(1536822319, 0)}
+ info := bindataFileInfo{name: "production/favicon.ico", size: 501, mode: os.FileMode(420), modTime: time.Unix(1537421095, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -99,7 +99,7 @@ func productionFirefoxPng() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "production/firefox.png", size: 4795, mode: os.FileMode(420), modTime: time.Unix(1536822319, 0)}
+ info := bindataFileInfo{name: "production/firefox.png", size: 4795, mode: os.FileMode(420), modTime: time.Unix(1537421095, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -156,8 +156,8 @@ var _productionIndexHTML = []byte(`
-
-
+
+