Skip to content

Commit 7df2f86

Browse files
committed
Moving transaction ID generation to JavaScript, for clip/transition moving logic - when using multiple clips/transitions in a undo/redo group. This was breaking on macOS when trying to call the Python UUID method.
1 parent 3d68a9c commit 7df2f86

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/timeline/js/directives/track.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ App.directive("tlTrack", function ($timeout) {
7070
var selected_item_count = ui_selected.length;
7171

7272
// Get uuid to group all these updates as a single transaction
73-
var tid = timeline.get_uuid();
73+
var tid = uuidv4();
7474
var drop_track_num = -1;
7575

7676
// with each dragged clip, find out which track they landed on

src/timeline/js/functions.js

+7
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@
2828

2929
/*global bounding_box, global_primes*/
3030

31+
// Generate a UUID
32+
function uuidv4() {
33+
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
34+
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
35+
);
36+
}
37+
3138
// Find a JSON element / object with a particular value in the json data
3239
function findElement(arr, propName, propValue) {
3340
// Loop through array looking for a matching element

0 commit comments

Comments
 (0)