Skip to content

Commit

Permalink
fix recreating files order
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieudutour committed Jul 11, 2017
1 parent a544fab commit 1c33e64
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"productName": "Kactus",
"bundleID": "io.kactus.KactusClient",
"companyName": "Kactus.io",
"version": "0.1.4",
"version": "0.1.5",
"main": "./main.js",
"repository": {
"type": "git",
Expand Down
14 changes: 11 additions & 3 deletions app/src/lib/dispatcher/app-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2072,15 +2072,15 @@ export class AppStore {
const gitStore = this.getGitStore(repository)
await gitStore.discardChanges(files)

await this._refreshRepository(repository)

// rebuild sketch files
const { kactus } = this.getRepositoryState(repository)
await Promise.all(
kactus.files
.filter(f => f.parsed)
.map(f => importSketchFile(f.path, kactus.config))
)

await this._refreshRepository(repository)
}

public async _undoCommit(
Expand Down Expand Up @@ -2273,7 +2273,15 @@ export class AppStore {
const gitStore = this.getGitStore(repository)
await gitStore.merge(branch)

return this._refreshRepository(repository)
// rebuild sketch files
const { kactus } = this.getRepositoryState(repository)
await Promise.all(
kactus.files
.filter(f => f.parsed)
.map(f => importSketchFile(f.path, kactus.config))
)

await this._refreshRepository(repository)
}

/** This shouldn't be called directly. See `Dispatcher`. */
Expand Down
3 changes: 3 additions & 0 deletions changelog.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"unreleased": [],
"releases": {
"0.1.5": [
"[Fixed] Recreate the sketch files before get the git status when merging a branch"
],
"0.1.4": [
"[Fixed] Remove kactus previews cache when removing a repo",
"[Fixed] Fix link to help",
Expand Down
2 changes: 1 addition & 1 deletion plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kactus",
"version": "0.1.4",
"version": "0.1.5",
"description": "Kactus plugin",
"main": "../out/plugin.sketchplugin",
"scripts": {
Expand Down

0 comments on commit 1c33e64

Please sign in to comment.