Skip to content

Commit

Permalink
fix(shareparam) edp963#1796
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanhan committed Jun 15, 2020
1 parent 3dce91f commit 1656f00
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions webapp/share/containers/Dashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,20 @@ export class Share extends React.Component<IDashboardProps, IDashboardStates> {

private deep_set(o, path, value) {
let i = 0
const val = decodeURIComponent(value)
for (; i < path.length - 1; i++) {
if (o[path[i]] === undefined) {
o[decodeURIComponent(path[i])] = path[i + 1].match(/^\d+$/) ? [] : {}
}
o = o[decodeURIComponent(path[i])]
if (o[path[i]] === undefined) {
o[decodeURIComponent(path[i])] = path[i + 1].match(/^\d+$/) ? [] : {}
}
o = o[decodeURIComponent(path[i])]
}
if (o[decodeURIComponent(path[i])] && o[decodeURIComponent(path[i])].length) {
if (!(o[decodeURIComponent(path[i])].includes(val))) {
o[decodeURIComponent(path[i])] = [val].concat( o[decodeURIComponent(path[i])])
}
} else {
o[decodeURIComponent(path[i])] = val
}
o[decodeURIComponent(path[i])] = decodeURIComponent(value)
}

private initPolling = (token) => {
Expand Down

0 comments on commit 1656f00

Please sign in to comment.