@cadraos/sdk 0.3.10 → 0.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kanban/index.cjs +12 -6
- package/dist/kanban/index.cjs.map +1 -1
- package/dist/kanban/index.js +12 -6
- package/dist/kanban/index.js.map +1 -1
- package/package.json +1 -1
package/dist/kanban/index.js
CHANGED
|
@@ -258,9 +258,12 @@ function useKanbanBoard(options) {
|
|
|
258
258
|
]);
|
|
259
259
|
setBoard(nextBoard);
|
|
260
260
|
setCards(cardList.cards);
|
|
261
|
-
setSelectedCard(
|
|
262
|
-
|
|
263
|
-
|
|
261
|
+
setSelectedCard((prev) => {
|
|
262
|
+
if (!prev) return prev;
|
|
263
|
+
const next = cardList.cards.find((c) => c.id === prev.id);
|
|
264
|
+
if (!next) return prev;
|
|
265
|
+
return next.run ? next : { ...next, run: prev.run };
|
|
266
|
+
});
|
|
264
267
|
} catch (err) {
|
|
265
268
|
fail(err, "Failed to load board");
|
|
266
269
|
} finally {
|
|
@@ -275,9 +278,12 @@ function useKanbanBoard(options) {
|
|
|
275
278
|
]);
|
|
276
279
|
setBoard(nextBoard);
|
|
277
280
|
setCards(cardList.cards);
|
|
278
|
-
setSelectedCard(
|
|
279
|
-
|
|
280
|
-
|
|
281
|
+
setSelectedCard((prev) => {
|
|
282
|
+
if (!prev) return prev;
|
|
283
|
+
const next = cardList.cards.find((c) => c.id === prev.id);
|
|
284
|
+
if (!next) return prev;
|
|
285
|
+
return next.run ? next : { ...next, run: prev.run };
|
|
286
|
+
});
|
|
281
287
|
} catch {
|
|
282
288
|
}
|
|
283
289
|
}, [adapter]);
|