Skip to content

Commit

Permalink
RavenDB-4033 fixed race condition between loading studio version and …
Browse files Browse the repository at this point in the history
…generating help link
  • Loading branch information
ppekrol committed Nov 17, 2015
1 parent b57e05e commit 55924b7
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions Raven.Studio.Html5/App/viewmodels/viewModelBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,20 @@ class viewModelBase {
public updateHelpLink(hash: string = null) {
if (hash) {
var version = viewModelBase.clientVersion();
var href = "http://ravendb.net/l/" + hash + "/" + version + "/";
ko.postbox.publish('globalHelpLink', href);
if (version) {
var href = "http://ravendb.net/l/" + hash + "/" + version + "/";
ko.postbox.publish('globalHelpLink', href);
return;
}

var subscribtion = viewModelBase.clientVersion.subscribe(v => {
var href = "http://ravendb.net/l/" + hash + "/" + v + "/";
ko.postbox.publish('globalHelpLink', href);

if (subscribtion) {
subscribtion.dispose();
}
});
} else {
ko.postbox.publish('globalHelpLink', null);
}
Expand Down

0 comments on commit 55924b7

Please sign in to comment.