feat: update currColor when currSet changed

This commit is contained in:
tristan 2019-09-16 13:19:24 +08:00
parent 0114d35366
commit 9c3f9aba04

View File

@ -63,7 +63,7 @@ const useColor = initialValue => {
if (payload.name == '') {
cs.colors = JSON.parse(localStorage.getItem('FAV_COLORS') || '[]');
}
return { ...state, currSet: cs };
return { ...state, currSet: cs, currColor: cs.colors[0] };
}
default:
throw new Error();