Skip to content

Commit 2be26dc

Browse files
authored
Merge pull request HaveAGitGat#183 from HaveAGitGat/dev
Dev
2 parents 08f7c26 + 5132da0 commit 2be26dc

File tree

17 files changed

+997
-595
lines changed

17 files changed

+997
-595
lines changed

‎ServiceAdd.js‎

Lines changed: 0 additions & 32 deletions
This file was deleted.

‎ServiceRemove.js‎

Lines changed: 0 additions & 16 deletions
This file was deleted.

‎ecosystem.config.js‎

Lines changed: 0 additions & 19 deletions
This file was deleted.

‎imports/ui/App.jsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default AppRouter = () => {
4444

4545
const [currentVersion, setVersion] = React.useState('');
4646

47-
const [newVersion, setNewVersion] = React.useState(1.105);
47+
const [newVersion, setNewVersion] = React.useState(1.106);
4848

4949

5050

‎imports/ui/item_Button.jsx‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,16 @@ export default class App extends Component {
8080

8181
render() {
8282

83-
// var temp ={
84-
// createdAt: new Date()
85-
86-
// }
8783

8884
var serverTime = this.props.time
89-
var lastUpdate = this.props.file.lastUpdate ? this.props.file.lastUpdate.getTime() : 0
90-
//this.props.time >= this.state.lastUpdate
91-
//this.state.showButton
85+
86+
87+
//dates are stringified when backup created:
88+
try {
89+
var lastUpdate = this.props.file.lastUpdate ? new Date(this.props.file.lastUpdate).getTime() : 0
90+
} catch (err) {
91+
var lastUpdate = 0
92+
}
9293

9394

9495
if (this.props.type == "updateDBAction") {

‎imports/ui/libraries/tab_Libraries.jsx‎

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ class App extends Component {
2727
super(props);
2828
this.clearFiles = this.clearFiles.bind(this);
2929

30-
this.state = { listItems: [1, 2],
31-
ready: false
30+
this.state = {
31+
listItems: [1, 2],
32+
ready: false,
33+
selectedLibrary:0,
3234

3335
};
3436
}
@@ -39,17 +41,19 @@ class App extends Component {
3941
if (confirm('Are you sure you want to delete all libraries?')) {
4042
Meteor.call('remove', function (error, result) { });
4143

42-
GlobalSettingsDB.upsert('globalsettings',
43-
{
44-
$set: {
45-
selectedLibrary: 0,
46-
}
47-
}
48-
);
44+
45+
this.setState({selectedLibrary: 0})
4946
}
5047
}
5148

5249

50+
setSelectedLibrary = (number) => {
51+
52+
this.setState({selectedLibrary: number})
53+
54+
}
55+
56+
5357

5458
addFolder = () => {
5559

@@ -646,14 +650,8 @@ class App extends Component {
646650
]
647651
});
648652

649-
GlobalSettingsDB.upsert('globalsettings',
650-
{
651-
$set: {
652-
selectedLibrary: count,
653-
}
654-
}
655-
);
656653

654+
this.setState({selectedLibrary: count})
657655

658656

659657
}
@@ -746,7 +744,8 @@ class App extends Component {
746744
<Folder
747745
key={item._id}
748746
libraryItem={item}
749-
backgroundColour={COLORS[(i+1) % 2]}
747+
backgroundColour={COLORS[(i+1) % 2]}
748+
setSelectedLibrary={this.setSelectedLibrary}
750749
/>
751750
</div></TabPanel>
752751

@@ -755,15 +754,9 @@ class App extends Component {
755754
));
756755

757756

758-
return <div className="tabWrap" > <Tabs selectedIndex={ this.props.globalSettings[0].selectedLibrary != undefined ? this.props.globalSettings[0].selectedLibrary : 0} onSelect={tabIndex => {
757+
return <div className="tabWrap" > <Tabs selectedIndex={ this.state.selectedLibrary != undefined ? this.state.selectedLibrary : 0} onSelect={tabIndex => {
759758

760-
GlobalSettingsDB.upsert('globalsettings',
761-
{
762-
$set: {
763-
selectedLibrary: tabIndex,
764-
}
765-
}
766-
);
759+
this.setState({selectedLibrary: tabIndex})
767760
}}>
768761
<TabList>
769762

0 commit comments

Comments
 (0)