FIX: Remote themes Github link should go to custom branch #9184

This commit is contained in:
Vinoth Kannan
2020-03-18 03:57:54 +05:30
parent 0b2e6f4301
commit 48d690ae01
4 changed files with 62 additions and 2 deletions

View File

@ -203,6 +203,17 @@ export default Controller.extend({
);
},
sourceIsHttp: match("model.remote_theme.remote_url", /^http(s)?:\/\//),
@discourseComputed(
"model.remote_theme.remote_url",
"model.remote_theme.branch"
)
remoteThemeLink(remoteThemeUrl, remoteThemeBranch) {
return remoteThemeBranch
? `${remoteThemeUrl.replace(/\.git$/, "")}/tree/${remoteThemeBranch}`
: remoteThemeUrl;
},
actions: {
updateToLatest() {
this.set("updatingRemote", true);