Skip to content

Commit c7f33ad

Browse files
Merge pull request #404 from GodotNuts/fix-utilities-issue
Fix utilities issue
2 parents 40e7b5c + c27bf9e commit c7f33ad

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

addons/godot-firebase/Utilities.gd

+2-13
Original file line numberDiff line numberDiff line change
@@ -57,24 +57,13 @@ static func from_firebase_type(value : Variant) -> Variant:
5757
return null
5858

5959
if value.has("mapValue"):
60-
value = _from_firebase_type_recursive(value.values()[0].fields)
60+
value = fields2dict(value.values()[0])
6161
elif value.has("timestampValue"):
6262
value = Time.get_datetime_dict_from_datetime_string(value.values()[0], false)
6363
else:
6464
value = value.values()[0]
6565

6666
return value
67-
68-
static func _from_firebase_type_recursive(value : Variant) -> Variant:
69-
if value == null:
70-
return null
71-
72-
if value.has("mapValue") or value.has("timestampValue"):
73-
value = _from_firebase_type_recursive(value.value()[0].fields)
74-
else:
75-
value = value.values()[0]
76-
77-
return value
7867

7968
static func to_firebase_type(value : Variant) -> Dictionary:
8069
var var_type : String = ""
@@ -103,7 +92,7 @@ static func fields2dict(doc) -> Dictionary:
10392
var dict = {}
10493
if doc.has("fields"):
10594
var fields = doc["fields"]
106-
print(fields)
95+
10796
for field in fields.keys():
10897
if fields[field].has("mapValue"):
10998
dict[field] = (fields2dict(fields[field].mapValue))

addons/godot-firebase/plugin.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
name="GodotFirebase"
44
description="Google Firebase SDK written in GDScript for use in Godot Engine 4.0 projects."
55
author="GodotNutsOrg"
6-
version="1.1"
6+
version="2.0"
77
script="plugin.gd"

0 commit comments

Comments
 (0)