lib/icarus/mod/firestore.rb in Icarus-Mod-Tools-1.3.4 vs lib/icarus/mod/firestore.rb in Icarus-Mod-Tools-1.3.5
- old
+ new
@@ -61,10 +61,11 @@
def update(type, payload, merge: false)
raise "You must specify a payload to update" if payload&.empty? || payload.nil?
case type
when :modinfo
- response = @client.doc(COLLECTIONS[:modinfo]).set({ list: payload }, merge:)
+ update_array = (modinfo_array + [payload]).flatten.uniq
+ response = @client.doc(COLLECTIONS[:modinfo]).set({ list: update_array }, merge:) if update_array.any?
when :repositories
response = @client.doc(COLLECTIONS[:repositories]).set({ list: payload }, merge:)
when :mod
response = update_or_create_mod(payload, merge:)
else