@adventurelabs/scout-core 1.0.23 → 1.0.24
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.
|
@@ -12,6 +12,18 @@ export function useScoutDbListener(scoutSupabase) {
|
|
|
12
12
|
}
|
|
13
13
|
function handleTagDeletes(payload) {
|
|
14
14
|
console.log("[DB Listener] Tag DELETE received:", payload.old);
|
|
15
|
+
console.log("[DB Listener] Tag DELETE - payload structure:", {
|
|
16
|
+
hasOld: !!payload.old,
|
|
17
|
+
oldId: payload.old?.id,
|
|
18
|
+
oldEventId: payload.old?.event_id,
|
|
19
|
+
oldClassName: payload.old?.class_name,
|
|
20
|
+
fullPayload: payload,
|
|
21
|
+
});
|
|
22
|
+
if (!payload.old || !payload.old.id) {
|
|
23
|
+
console.error("[DB Listener] Tag DELETE - Invalid payload, missing tag data");
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
console.log("[DB Listener] Tag DELETE - Dispatching deleteTag action with ID:", payload.old.id);
|
|
15
27
|
dispatch(deleteTag(payload.old));
|
|
16
28
|
}
|
|
17
29
|
function handleTagUpdates(payload) {
|
|
@@ -112,22 +112,22 @@ export declare function useSupabase(): SupabaseClient<Database, "public", {
|
|
|
112
112
|
location: unknown | null;
|
|
113
113
|
media_type: Database["public"]["Enums"]["media_type"];
|
|
114
114
|
media_url: string | null;
|
|
115
|
-
message: string;
|
|
115
|
+
message: string | null;
|
|
116
116
|
timestamp_observation: string;
|
|
117
117
|
};
|
|
118
118
|
Insert: {
|
|
119
|
-
altitude
|
|
119
|
+
altitude?: number;
|
|
120
120
|
device_id: number;
|
|
121
121
|
earthranger_url?: string | null;
|
|
122
122
|
file_path?: string | null;
|
|
123
|
-
heading
|
|
123
|
+
heading?: number;
|
|
124
124
|
id?: number;
|
|
125
125
|
inserted_at?: string;
|
|
126
126
|
is_public?: boolean;
|
|
127
127
|
location?: unknown | null;
|
|
128
128
|
media_type?: Database["public"]["Enums"]["media_type"];
|
|
129
129
|
media_url?: string | null;
|
|
130
|
-
message
|
|
130
|
+
message?: string | null;
|
|
131
131
|
timestamp_observation?: string;
|
|
132
132
|
};
|
|
133
133
|
Update: {
|
|
@@ -142,7 +142,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", {
|
|
|
142
142
|
location?: unknown | null;
|
|
143
143
|
media_type?: Database["public"]["Enums"]["media_type"];
|
|
144
144
|
media_url?: string | null;
|
|
145
|
-
message?: string;
|
|
145
|
+
message?: string | null;
|
|
146
146
|
timestamp_observation?: string;
|
|
147
147
|
};
|
|
148
148
|
Relationships: [{
|
|
@@ -505,7 +505,7 @@ export declare function useSupabase(): SupabaseClient<Database, "public", {
|
|
|
505
505
|
location: unknown | null;
|
|
506
506
|
media_type: Database["public"]["Enums"]["media_type"];
|
|
507
507
|
media_url: string | null;
|
|
508
|
-
message: string;
|
|
508
|
+
message: string | null;
|
|
509
509
|
timestamp_observation: string;
|
|
510
510
|
}[];
|
|
511
511
|
};
|
package/dist/store/scout.js
CHANGED
|
@@ -76,19 +76,25 @@ export const scoutSlice = createSlice({
|
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
deleteTag(state, action) {
|
|
79
|
+
console.log("[Redux] deleteTag action called with:", action.payload);
|
|
80
|
+
console.log("[Redux] deleteTag - Looking for tag ID:", action.payload.id);
|
|
79
81
|
for (const herd_module of state.herd_modules) {
|
|
80
82
|
for (const event of herd_module.events) {
|
|
81
83
|
if (!event.tags) {
|
|
82
84
|
continue;
|
|
83
85
|
}
|
|
86
|
+
console.log(`[Redux] deleteTag - Checking event ${event.id}, has ${event.tags.length} tags`);
|
|
84
87
|
for (const tag of event.tags) {
|
|
85
88
|
if (tag.id === action.payload.id) {
|
|
89
|
+
console.log(`[Redux] deleteTag - Found tag ${tag.id} in event ${event.id}, removing it`);
|
|
86
90
|
event.tags = event.tags.filter((t) => t.id !== tag.id);
|
|
91
|
+
console.log(`[Redux] deleteTag - After removal, event ${event.id} has ${event.tags.length} tags`);
|
|
87
92
|
return;
|
|
88
93
|
}
|
|
89
94
|
}
|
|
90
95
|
}
|
|
91
96
|
}
|
|
97
|
+
console.log("[Redux] deleteTag - Tag not found in any event");
|
|
92
98
|
},
|
|
93
99
|
updateTag(state, action) {
|
|
94
100
|
for (const herd_module of state.herd_modules) {
|
|
@@ -110,22 +110,22 @@ export declare function newServerClient(): Promise<import("@supabase/supabase-js
|
|
|
110
110
|
location: unknown | null;
|
|
111
111
|
media_type: Database["public"]["Enums"]["media_type"];
|
|
112
112
|
media_url: string | null;
|
|
113
|
-
message: string;
|
|
113
|
+
message: string | null;
|
|
114
114
|
timestamp_observation: string;
|
|
115
115
|
};
|
|
116
116
|
Insert: {
|
|
117
|
-
altitude
|
|
117
|
+
altitude?: number;
|
|
118
118
|
device_id: number;
|
|
119
119
|
earthranger_url?: string | null;
|
|
120
120
|
file_path?: string | null;
|
|
121
|
-
heading
|
|
121
|
+
heading?: number;
|
|
122
122
|
id?: number;
|
|
123
123
|
inserted_at?: string;
|
|
124
124
|
is_public?: boolean;
|
|
125
125
|
location?: unknown | null;
|
|
126
126
|
media_type?: Database["public"]["Enums"]["media_type"];
|
|
127
127
|
media_url?: string | null;
|
|
128
|
-
message
|
|
128
|
+
message?: string | null;
|
|
129
129
|
timestamp_observation?: string;
|
|
130
130
|
};
|
|
131
131
|
Update: {
|
|
@@ -140,7 +140,7 @@ export declare function newServerClient(): Promise<import("@supabase/supabase-js
|
|
|
140
140
|
location?: unknown | null;
|
|
141
141
|
media_type?: Database["public"]["Enums"]["media_type"];
|
|
142
142
|
media_url?: string | null;
|
|
143
|
-
message?: string;
|
|
143
|
+
message?: string | null;
|
|
144
144
|
timestamp_observation?: string;
|
|
145
145
|
};
|
|
146
146
|
Relationships: [{
|
|
@@ -503,7 +503,7 @@ export declare function newServerClient(): Promise<import("@supabase/supabase-js
|
|
|
503
503
|
location: unknown | null;
|
|
504
504
|
media_type: Database["public"]["Enums"]["media_type"];
|
|
505
505
|
media_url: string | null;
|
|
506
|
-
message: string;
|
|
506
|
+
message: string | null;
|
|
507
507
|
timestamp_observation: string;
|
|
508
508
|
}[];
|
|
509
509
|
};
|
package/dist/types/supabase.d.ts
CHANGED
|
@@ -144,22 +144,22 @@ export type Database = {
|
|
|
144
144
|
location: unknown | null;
|
|
145
145
|
media_type: Database["public"]["Enums"]["media_type"];
|
|
146
146
|
media_url: string | null;
|
|
147
|
-
message: string;
|
|
147
|
+
message: string | null;
|
|
148
148
|
timestamp_observation: string;
|
|
149
149
|
};
|
|
150
150
|
Insert: {
|
|
151
|
-
altitude
|
|
151
|
+
altitude?: number;
|
|
152
152
|
device_id: number;
|
|
153
153
|
earthranger_url?: string | null;
|
|
154
154
|
file_path?: string | null;
|
|
155
|
-
heading
|
|
155
|
+
heading?: number;
|
|
156
156
|
id?: number;
|
|
157
157
|
inserted_at?: string;
|
|
158
158
|
is_public?: boolean;
|
|
159
159
|
location?: unknown | null;
|
|
160
160
|
media_type?: Database["public"]["Enums"]["media_type"];
|
|
161
161
|
media_url?: string | null;
|
|
162
|
-
message
|
|
162
|
+
message?: string | null;
|
|
163
163
|
timestamp_observation?: string;
|
|
164
164
|
};
|
|
165
165
|
Update: {
|
|
@@ -174,7 +174,7 @@ export type Database = {
|
|
|
174
174
|
location?: unknown | null;
|
|
175
175
|
media_type?: Database["public"]["Enums"]["media_type"];
|
|
176
176
|
media_url?: string | null;
|
|
177
|
-
message?: string;
|
|
177
|
+
message?: string | null;
|
|
178
178
|
timestamp_observation?: string;
|
|
179
179
|
};
|
|
180
180
|
Relationships: [
|
|
@@ -556,7 +556,7 @@ export type Database = {
|
|
|
556
556
|
location: unknown | null;
|
|
557
557
|
media_type: Database["public"]["Enums"]["media_type"];
|
|
558
558
|
media_url: string | null;
|
|
559
|
-
message: string;
|
|
559
|
+
message: string | null;
|
|
560
560
|
timestamp_observation: string;
|
|
561
561
|
}[];
|
|
562
562
|
};
|