Skip to content

Commit

Permalink
fix: remove duplicates from auto registration array using set (#7192)
Browse files Browse the repository at this point in the history
  • Loading branch information
markemer authored Jan 16, 2024
1 parent e148db7 commit c4984ae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ios/Capacitor/Capacitor/CapacitorBridge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Cordova
internal typealias CapacitorPlugin = CAPPlugin & CAPBridgedPlugin

struct RegistrationList: Codable {
let packageClassList: [String]
let packageClassList: Set<String>
}

/**
Expand Down Expand Up @@ -288,6 +288,7 @@ open class CapacitorBridge: NSObject, CAPBridgeProtocol {
if let pluginJSON = Bundle.main.url(forResource: "capacitor.config", withExtension: "json") {
let pluginData = try Data(contentsOf: pluginJSON)
let registrationList = try JSONDecoder().decode(RegistrationList.self, from: pluginData)

for plugin in registrationList.packageClassList {
if let pluginClass = NSClassFromString(plugin) {
if class_getSuperclass(pluginClass) == CDVPlugin.self {
Expand Down

0 comments on commit c4984ae

Please sign in to comment.