mirror of https://github.com/status-im/fathom.git
open site settings when there are 0 sites in db
This commit is contained in:
parent
e4e4bfdea6
commit
3e06bea6c7
|
@ -3,7 +3,7 @@ node_modules
|
||||||
!.env.example
|
!.env.example
|
||||||
coverage.out
|
coverage.out
|
||||||
build
|
build
|
||||||
fathom.db
|
*.db
|
||||||
fathom
|
fathom
|
||||||
!cmd/fathom
|
!cmd/fathom
|
||||||
|
|
||||||
|
|
|
@ -41,8 +41,15 @@ class Dashboard extends Component {
|
||||||
fetchSites() {
|
fetchSites() {
|
||||||
Client.request(`sites`)
|
Client.request(`sites`)
|
||||||
.then((sites) => {
|
.then((sites) => {
|
||||||
let site = sites.length > 0 ? sites[0] : defaultSite
|
// open site settings when there are no sites yet
|
||||||
let s = sites.find(s => s.id == defaultSite.id)
|
if(sites.length == 0) {
|
||||||
|
this.showSiteSettings({ id: 0, name: "yoursite.com"})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if there are sites, use remembered site as selected site
|
||||||
|
let site = sites[0];
|
||||||
|
let s = sites.find(s => s.id == defaultSite.id);
|
||||||
site = s ? s : site;
|
site = s ? s : site;
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|
Loading…
Reference in New Issue