Skip to content

Commit

Permalink
fix(post-flow): add user's url to cache path
Browse files Browse the repository at this point in the history
avoid conffict after switched user
  • Loading branch information
ElonH committed May 20, 2020
1 parent 2faad6e commit 98a9fc2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/app/@dataflow/rclone/post-flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { AjaxRequest, AjaxResponse } from 'rxjs/ajax';
import { FlowSupNode, FlowOutNode, CombErr } from '../core';
import { AjaxFlow } from '../core/ajax-flow';
import { IRcloneServer } from '../extra';
import { Observable } from 'rxjs';

export type AjaxFlowNode = [AjaxResponse | object, Error[]];

Expand Down Expand Up @@ -39,8 +40,10 @@ export abstract class PostFlow<
body: this.params,
};
}
public deploy() {
if (!this.cachePath) this.cachePath = JSON.stringify([this.cmd, this.params]);
super.deploy();
protected request(pre: CombErr<Tin>): Observable<CombErr<Tout>> {
if (pre[1].length === 0) {
this.cachePath = JSON.stringify([this.cmd, this.params, pre[0].url]);
}
return super.request(pre);
}
}

0 comments on commit 98a9fc2

Please sign in to comment.