Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove duplicates from auto registration array using set #7192

Merged
merged 2 commits into from
Jan 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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