Make sure that the default theme is the first one listed in themes.yml (#229)

We want the default theme to be Aubergine since that is the default that comes
with Slack. However, we were actually relying on the first theme in alphabetical
sorted order as the default theme, which ended up changing the default as themes
got added.

This patch always makes it the first entry in the themes.yml file
This commit is contained in:
Ufuk Kayserilioglu authored and GitHub committed 2018-12-13 12:13:04 -05:00
1 parent 65c2d2b2f6
commit aea00e4941
2 files changed
+10 -2

No files matched your search

+8
View File
@@ -105,4 +105,12 @@ helpers do
))
end
end
def default_theme
theme = data.themes.first
OpenStruct.new(theme.merge(
slug: theme['name'].parameterize.underscore,
digest: Digest::MD5.new.hexdigest(theme['colors'])
))
end
end
+2 -2
View File
@@ -9,10 +9,10 @@ app.config(['$stateProvider', '$urlRouterProvider',
url: "/:slug",
controller: 'ThemeController',
params: {
slug: { value: '<%= themes.first.slug %>' }
slug: { value: '<%= default_theme.slug %>' }
}
});
$urlRouterProvider.otherwise('/<%= themes.first.slug %>');
$urlRouterProvider.otherwise('/<%= default_theme.slug %>');
}]);
app.controller('ThemeController', ['$scope', '$stateParams', '$state', '$location',