Skip to content

Commit d79b251

Browse files
committed
change exported name and id for uniqueness on import
1 parent 36fd522 commit d79b251

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/assets/style/sidebar.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@
447447
color: rgb(216, 216, 216);
448448
border: 0;
449449
cursor: pointer;
450+
outline: none;
450451
}
451452
.collection-import-container {
452453
display: flex;
@@ -463,6 +464,7 @@
463464
color: rgb(216, 216, 216);
464465
border: 0;
465466
cursor: pointer;
467+
outline: none;
466468
}
467469
.collections-container {
468470
min-height: 150px;

src/client/controllers/collectionsController.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as store from '../store';
22
import * as actions from '../actions/actions';
33
import db from '../db';
44
import { ipcRenderer } from 'electron';
5+
import uuid from 'uuid/v4';
56

67
ipcRenderer.on('add-collection', (event, args) => {
78
console.log('here');
@@ -45,13 +46,16 @@ const collectionsController = {
4546

4647
exportCollection(id) {
4748
db.collections.where('id').equals(id).first(foundCollection => {
49+
// change name and id of collection to satisfy uniqueness requirements of db
50+
foundCollection.name = foundCollection.name + " import";
51+
foundCollection.id = uuid();
52+
4853
ipcRenderer.send('export-collection', {collection: foundCollection});
4954
})
5055
.catch((error) => {
5156
console.error(error.stack || error);
5257
reject(error);
5358
});
54-
console.log('exporting collection', id);
5559
},
5660

5761
importCollection() {

0 commit comments

Comments
 (0)