Skip to content

Commit

Permalink
Add Clear Gist Caches menu option
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Aug 19, 2016
1 parent 3916a9f commit 4e8f2e0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/Gistlyn/src/app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Gistlyn/src/app.js.map

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions src/Gistlyn/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,17 @@ class App extends React.Component<any, any> {
}
}

clearGistCache() {
var removeKeys = [];
for (var i = 0; i < localStorage.length; i++) {
const key = localStorage.key(i);
if (key.startsWith("/v1/gists/")) {
removeKeys.push(key);
}
}
removeKeys.forEach(key => localStorage.removeItem(key));
}

revertGist(shiftKey: boolean = false, ctrlKey:boolean = false) {
localStorage.removeItem(GistCacheKey(this.props.gist));

Expand Down Expand Up @@ -777,6 +788,8 @@ class App extends React.Component<any, any> {
<div onClick={e => this.props.changeGist(GistTemplates.NewCollection) }>New Collection</div>));
MorePopup.push((
<div onClick={e => this.props.showDialog("shortcuts") }>Shortcuts</div>));
MorePopup.push((
<div onClick={e => this.clearGistCache() }>Clear Gist Caches</div>));
MorePopup.push((
<div onClick={e => window.open("https://github.com/ServiceStack/Gistlyn/issues") }>Send Feedback</div>));

Expand Down

0 comments on commit 4e8f2e0

Please sign in to comment.