Skip to content

Commit

Permalink
- Tags update without jumps
Browse files Browse the repository at this point in the history
- Fix tags style
- Save to Unsorted always
- Unshift images from /parse + local
  • Loading branch information
Rustem Mussabekov committed Nov 28, 2019
1 parent da8c327 commit da1296a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion internals/buildversion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
580
584
4 changes: 2 additions & 2 deletions src/routes/edit/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ export default class Edit extends React.Component {
this.unsubscribeBookmark();
}

handleBookmarkChange(obj, callback) {
bookmarkActions.update(obj, callback);
handleBookmarkChange(obj, callback, options) {
bookmarkActions.update(obj, callback, options);
}

goTo(url, withAnim = false) {
Expand Down
12 changes: 7 additions & 5 deletions src/routes/edit/tags2/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ const selectStyles = {
control: (styles, { isFocused })=>({
...styles,
border: 0,
minHeight: '26px',
boxShadow: isFocused ? 'inset 0 0 0 1px var(--accentColor, #4a90e2)' : 'inset 0 0 0 var(--thin-border, 1px) var(--thin-border-color-plus, rgba(0,0,0,.15))'
minHeight: '29px',
boxShadow: isFocused ? 'inset 0 0 0 1px var(--accentColor, #4a90e2), 0 0 0 var(--thin-border, 1px) var(--accentColor, #4a90e2)' : 'inset 0 0 0 var(--thin-border, 1px) var(--thin-border-color-plus, rgba(0,0,0,.15))'
}),
dropdownIndicator: ()=>({ display: 'none' }),
multiValue: (styles)=>({ ...styles, backgroundColor: 'var(--accentColor, #4a90e2)' }),
multiValue: (styles)=>({ ...styles, backgroundColor: 'var(--accentColor, #4a90e2)', fontSize: '15px' }),
multiValueLabel: (styles)=>({ ...styles, color: 'white' }),
multiValueRemove: (styles)=>({ ...styles, color: 'white', ':hover': { backgroundColor: 'rgba(0,0,0,.25)' } }),
valueContainer: (styles)=>({ ...styles, padding: '2px 3px' })
valueContainer: (styles)=>({ ...styles, padding: '2px 3px' }),
indicatorSeparator: ()=>({ display: 'none' })
}

export default class Tags extends React.Component {
Expand Down Expand Up @@ -63,7 +64,8 @@ export default class Tags extends React.Component {
}

onSelectChange = (selected)=>{
this.props.onChange({tags: selected.map(({value})=>value) })
this.setState({ selected })
this.props.onChange({tags: selected.map(({value})=>value) }, ()=>{}, {trigger: false})
}

formatCreateLabel = (input)=>`+${input}`
Expand Down
10 changes: 6 additions & 4 deletions src/stores/bookmark.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ export default createStore({
return new Promise((res,rej)=>{
item.collectionId = -1;

if (!tryAgain){
/*if (!tryAgain){
try{item.collectionId = UserStore.getUser().config.last_collection}catch(e){}
if (item.collectionId == -99)
item.collectionId = -1;
}
}*/

Api.post("raindrop", item, (json)=>{
if (!json.result){
Expand Down Expand Up @@ -351,8 +351,10 @@ export default createStore({

if (updateBookmark){
var upd = {type: json.item.type, html: json.item.html||""}
if ((_state.item.media||[]).length==0)
upd.media = json.item.media||[];
upd.media = [
...json.item.media||[],
..._state.item.media||[]
]

this.onUpdate(upd)
}
Expand Down

0 comments on commit da1296a

Please sign in to comment.